Records data events

Reference topic for the records data code events set.

Table 1. Records data events
Event Use when ... Function

On Select Rows

Use this event to include custom code immediately prior to the application running the SELECT statement that returns the data.

When the application is built, a SELECT statement is generated based on the settings in the business record. This SELECT statement is the input to the function that implements this code event; it is also returned by the function.

You could manipulate the string variable to return an altered SELECT statement; however, you should first determine whether you can update the business record to generate the correct SELECT statement without resorting to a code event.

OnSelectRows

Before Insert Row

Use this event to validate values inserted in a newly-created row. You can test several fields.

This event is executed when a new row is created in an INPUT ARRAY. It is triggered before the row is inserted in the database.

BeforeInsertRow

After Insert Row

Use this event to perform some operation, typically a SQL operation, on another table. For example, you may need to record details about the inserted row of data in a log table. This event is triggered as the row is inserted in the database.

AfterInsertRow

Before Update Row

Use this event to check if something has changed, such as a quantity that must not exceed a certain value, or must satisfy a constraint. You can test several fields.

This event is triggered when a user modifies a field and then presses the 'accept' action.

BeforeUpdateRow

After Update Row

Use this event to perform some operation, typically a SQL operation, on another table. For example, you could record details about the updated row of data in a log table. This event is triggered after updating a row in the database.

AfterUpdateRow

Before Delete Row With ConcurrentAccess

Use this event to perform some operation, typically a SQL operation, on another table. For example, you could write the row of data to a backup table before the row is deleted. This event is called before deleting a row in the database where a table can be locked.

BeforeDeleteRowWithConcurrentAccess

After Delete Row With ConcurrentAccess

Use this event to perform some operation, typically a SQL operation, on another table. For example, you could record details about the deleted row of data to a log table. This event is triggered after deleting a row in the database where a table can be locked.

AfterDeleteRowWithConcurrentAccess

Before Delete Row

Use this event to perform some operation, typically a SQL operation, on another table. For example, you could write the row of data to a backup table before the row is deleted. This event is called before deleting a row in the database.

BeforeDeleteRow

After Delete Row

Use this event to perform some operation, typically a SQL operation, on another table. For example, you could record details about the deleted row of data to a log table. This event is triggered after deleting a row in the database.

AfterDeleteRow

On Default Values

Use this event if you need to change a default value, or if you want to set a default value for a field that does not have a default value defined in the database schema. This function is called to initialize the business record with default values.

OnDefaultValues
On Computed Fields

Use this event to update fields in a business record prior to the record being written to the report.

The parameter is passed by reference (INOUT); changes to the fields of a record remain after the function completes.

In this event function:
  • You could calculate a field value, such as a computed value from one or more columns in the record.
  • You could concatenate text columns, such as an address, and display in one field.
OnComputedFields