Event aread_before

This event is called before an instance of a class will be filled with a data set extracted from the database. Thus, it can be called at query time, at detail display time, or at the beginning of an edit activity.

When the event is called, the instance is present but no read operation has been performed on the database. This means that the read operation can be refused by setting an error.

This event must be called only on the main class and not on nested classes as it will be done for the AREAD_AFTER event.

Context

The instance this is present but empty, the table declared in the class logic is opened, but no read operation has been done.

The following variables or properties are available in the context:

  • The key values that will be used for the Read operation are local variables named COLUMN, where COLUMN is the property on which the key is based. For example, if the main key of a table is based on two columns called AXIS and SEGMENT, [L]AXIS and [L]SEGMENT will store the key values used to read the main record.
  • CURPTH is empty because this method is only called on a main class.
  • AEVENT is equal to AREAD_BEFORE.

If an error is thrown by the ASETERROR method, a read attempt in the database will not be performed and a message "record does not exist" will be displayed.