Creating a Field Rule Event
Events are pre-named Alpha Anywhere actions that are associated with certain Alpha Anywhere components. For example, clicking on a button on a form initiates an event called OnPush. When you click on a field, form or browse, a series of events happen. This series includes the OnArrive event for the field you clicked on, and the OnDepart event for the field you left. Alpha Anywhere lets you attach Xbasic code that executes when specific events like these occur.
For more information, see Field Rule Field Events and Field Rule Record Events. In the Field Rules Editor you can enter Xbasic code for the following field events:
- Event Name
Before the cursor enters the field.
After the cursor enters the field.
Before the cursor exits the field.
After the cursor exits the field.
and for the following record events:
- Event Name
Before entering Change mode.
After entering Change mode.
Before deleting a record.
After deleting a record.
Before moving to the new record.
After moving to the new record
Before marking a record.
After marking a record.
Before saving a record.
After saving a record.
Before unmarking a record.
After unmarking a record.
Creating a Event Field Rule
Select the table in the Table/Sets tab of the Control Panel.
Select Design > Field Rules.
If you are creating field event, select the field in the drop-down list box at the upper left corner of the dialog box.
Display the Events tab.
Click the Field Events radio button if you are creating a field event. Otherwise, click the Record Events radio button.
Select the event from the Event list box.
Optionally, enter the Xbasic code into the text box.The a_current_field system variable is a pointer to the current field. The a_current_field.name_get() method returns the name of the current field.
Optionally, click Open Code Editor to use all the resources of the full Xbasic development environment.