Recordset Field Events

The events available for creating event handlers associated with recordset fields are described below.

Read Field

The Read Field event is fired during the course of reading the current screen of the recordset. It reads the contents of a field.

Possible uses:

Notes:

This event is invoked for each instance of a field in a recordset. It is fired after the Parse Screen and Parse Record events.

The default result is "scraped" from the terminal, passed to the model-defined post-processing for white-space and symbol removal, and then sent to the event handler.

The value returned from the event handler is treated as the value of the field. Changing the current entity during this event is not supported and causes the event to fail. Also, attempting any action on the recordset from which the event fired results in an error. Otherwise, there are no pre-defined conditions that result in an error.

See the ScriptHostSession API topic regarding restrictions on changing terminal state using this event.

Write Field

The Write Field event is fired whenever a request is received to write data to a field.

Possible uses:

Notes:

This event is fired whenever data needs to be written to a field. Typically, this occurs inside an update or insert record request, but can also occur as result of a command such as TransmitToRecordsetField.

The input data is passed to the event handler with no pre-processing.

Examples of event handler actions include:

Host Integrator accepts whatever actions are taken by the event handler as intentional, including omitting any terminal updates. Changing the current entity during this event is not recommended, as there may be additional actions pending that depend on the current entity remaining the same. Otherwise, there are no predefined conditions that result in an error.

The default callback performs the model-defined pre-processing for pre-pending, appending, and white-space padding. It then executes any pre-write operation, verifies the length of the data and state of the terminal, positions the cursor as needed, transmits the data to the terminal, and executes any post-write operation.


 

Related Topics
Bullet Event handler guidelines
Bullet Event handler API overview