Dataset FILL events
- Last Updated: September 14, 2021
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
There are two types of FILL events. One event type is triggered at the dataset level. The other event type is triggered at the level of the temp-table buffer of a dataset. During the FILL operation for a dataset or a temp-table buffer, events are automatically triggered in the AVM. You can write an event handler to execute custom code when a particular FILL event triggers.
Fill events at the dataset level include BEFORE-FILL and
AFTER-FILL. They are shown in gray in the following illustration.
Fill events at the temp-table buffer of a dataset level include
BEFORE-FILL, AFTER-FILL,
BEFORE-ROW-FILL and AFTER-ROW-FILL. These events
are shown in blue, green, and red in the illustration, and are discussed in the next
topic.
The dataset level FILL events, BEFORE-FILL and
AFTER-FILL are summarized in the table.
| Event | When it occurs | Examples |
|---|---|---|
BEFORE-FILL |
Prior to the retrieval of the first record in a FILL operation; executes once per FILL operation on a dataset |
|
AFTER-FILL |
After the retrieval of the last record in a FILL operation; executes once per FILL operation on a dataset |
|
Alternatively, you do not need to use an event to perform these operations. The
operations can be performed before or after the call to FILL in your
code.
NO-FILL. BEFORE-FILL on a dataset
In this example, the BEFORE-FILL event handler prepares the top-level
query for the FILL operation.
|
In the internal procedure (preDataSetFill),
the dataset is loaded with initial data from a JSON file called Orders.json.
AFTER-FILL on a dataset
In this example, after all the tables are filled the AFTER-FILL event handler detaches the data-sources for all temp-tables in
the dataset.
|
This procedure uses the NUM-BUFFERS attribute and the
GET-BUFFER-HANDLE method to detach all the data-sources in a single
procedure call.