Defining Data Dictionary Events

Part of the Data Dictionaries class creation process is the defining of custom behaviors in events. These events allow you to customize the main Data Dictionary processes. Those processes are: Find, Clear, Save, and Delete.

Events are provided to allow you to control the following:

 

A single event may be used by multiple operations. For example, the Backout event is called during a save and a delete. The Relate_Main_File event may be called by saves, deletes, finds and clears.

Some events are always called in a locked state (e.g. Update and Backout) while other events may be called in an unlocked state (e.g. Relate_Main_File).

The predefined Data Dictionary events are:

 

Forward Sending Event Messages

You should always forward event messages.

Although some of the Data Dictionary events perform no default action other events perform very important tasks and must be forwarded. Unless you specifically want to cancel a behavior, you are advised to always forward your event augmentations. This creates code that is robust – it will work the first time and it will continue to work as changes are made to your underlying classes. So, while we could code an event as follows:

// incorrect

Procedure Update

    Move (Customer.due + order.total) to Customer.due

End_Procedure

We will instead code this with a forward send:

// correct

Procedure Update

    Forward send Update

    Move (Customer.due + order.total) to Customer.due

End_Procedure

User Defined Field Events

Data Dictionaries allow you to define events that should be called when a field is validated and when windows data-entry objects bound to a particular field are entered or exited. These events are tied to fields using the Field_Validate_msg, Field_Entry_msg and Field_Exit_msg and are discussed in there own sections. In particular, the field validation events can be particularly useful.

See Also

Defining Data Dictionary Classes