PreviousNextIndex

MARK-ROW-STATE( ) method

Forces the creation of before-table records and assigns ROW-STATE.

Return type: LOGICAL

Applies to: Buffer object handle

If a ProDataSet contains changes to be applied to a data-source, but no BEFORE-TABLE records exist for it and therefore no ROW-STATE, you may still want to use the SAVE-ROW-CHANGES( ) method to move the new data from the ProDataSet to the source database. However, this is problematic, since SAVE-ROW-CHANGES( ) requires a before-table record with a ROW-STATE for each record to be saved. This method creates the before-table records needed by SAVE-ROW-CHANGES( ).

Syntax
MARK-ROW-STATE( row-state [, before-image source buffer handle ] ) 

row-state
before-image source buffer handle

If row-state is ROW-UNMODIFIED, or if there is already a before-table record, no action is taken.

If row-state is ROW-CREATED, a before-table record is created and its ROW-STATE is marked as ROW-CREATED. The before-table record is associated with the buffer object handle record.

If row-state is ROW-MODIFIED and the second optional parameter is defined, a before-image record is created by copying the before-image source buffer. If the second parameter is not defined, then a data-source must be attached to the buffer object handle. In this case the data-source mapping is used to locate the data-source record(s) related to the buffer object handle, which is used to create a before-table record. The before-table record is marked ROW-MODIFIED and is associated with the buffer object handle record.

Note: If the second parameter is not defined and if the data-source top level record cannot be located, then a ROW-CREATED before-table record will be created and associated with the buffer object handle record.

If row-state is ROW-DELETED and the second optional parameter is defined, a before-image record is created by copying the before-image source buffer. If the second parameter is not defined, then a data-source must be attached to buffer object handle. In this case the data-source mapping is used to locate the data-source record(s) related to buffer object handle, which then can be used to create a before-table record.

If a second parameter is not defined, then the buffer object handle must contain a temporary record whose only purpose is to locate the data-source. Otherwise it can be empty.

Note that if buffer object handle is for a static table that was defined without a BEFORE-TABLE option, MARK-ROW-STATE( ) causes the AVM to raise ERROR. If buffer object handle is for a dynamic table that has no before-table, one is automatically created.

See also: MARK-NEW( ) method, ROW-STATE attribute, SAVE-ROW-CHANGES( ) method


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex