Makes contents of a row editable.

Syntax

<oRef>.beginEdit( )

<oRef>

The rowset you want to put in Edit mode.

Property of

Rowset

Description

By default, a rowset’s autoEdit property is true, which means that data is immediately editable. The rowset implicitly calls beginEdit( ) when a destructive keystroke is typed in a dataLinked component. But you can more strictly control how editing occurs by setting autoEdit to false and explicitly calling beginEdit( ) as needed.

As usual, the row buffer is not written until the rowset’s save( ) method is explicitly called or there is an implicit save, which is usually caused by navigation in the rowset. The integrity of the data in the row, for example making sure that there are no invalid entries in any fields, should be checked in the rowset’s canSave event. The abandon( ) method will discard any changes to the row. After saving or abandoning any changes, the rowset goes back to Browse mode.

The rowset’s canEdit event is fired when beginEdit( ) is called. If there is a canEdit event handler, it must return true or the beginEdit( ) will not proceed. The onEdit event is fired after switching to Edit mode.

The order of events when calling beginEdit( ) is as follows, even if the rowset is already in Edit mode:

  1. If the rowset has a canEdit event handler, it is called. If not, it’s as if canEdit returns true.

The rowset attempts to switch to Edit mode by getting an automatic row lock. If the lock cannot be secured, the mode switch fails and beginEdit( ) returns false.

If the lock is secured, the onEdit event fires.

The beginEdit( ) method returns true.

An exception occurs if the rowset’s live property is false, or if the user has insufficient rights to edit rows, and they call beginEdit( ).