Try OpenEdge Now
skip to main content
ProDataSets
Updating Data with ProDataSets : ProDataSet change events : Applying callback procedures programmatically
 

Applying callback procedures programmatically

For both fill-related and change-related events, you might want to have any callback procedures applied programmatically at times other than when the AVM executes them automatically. For example, you might be writing code that populates a ProDataSet without doing an actual FILL method, or you might want to share logic between the FILL and the change process. To make the use of callback procedures as flexible as possible, there is an APPLY-CALLBACK method for use on a ProDataSet temp-table buffer handle, which you can use to make sure that any callback procedure that is defined for the event also executes at other times when you want it to. This spares you from having to write an explicit call that duplicates an event procedure definition.
This is the syntax for the APPLY-CALLBACK method:

Syntax

dataset-or-buffer-handle:APPLY-CALLBACK(event-name).
The AVM passes the ProDataSet into the callback procedure as a parameter. If there is no callback procedure, then nothing happens. The whole intent is to provide consistent behavior (including no behavior at all if there is no event code).