Assign a Script to an Event
To assign a Script to an Event, you simply call up the Script Editor window, select the Event you want and then create your Script within the editor.
When you have finished with one Script, you can select another Event and create another Script. When you select another Event or close the Script Editor window, your Scripts are automatically saved and assigned to the Event(s).
You can also edit existing Scripts within the editor in the same way.
The Script Editor allows you to create and edit Scripts for Events at the application level or the form/control level. If you are working with the application Events, you cannot choose a form or control Event. Likewise, if you are working with form Events and control Events you cannot edit an application Event.
Within the Properties for the Project, a form or a Control, if that element has associated Events, you will find an Events Property category. Within this you will find the Properties for each available Event. If no Script has been assigned to an Event, the Property value will display as <Create>; if a Script has been assigned the value will be <Edit>.
To load the Script Editor to create or edit a Script:
To work with Application Events, display the Project Properties in the Properties Pane – click on the root node in the Forms or Data Sources Panes or right-click in either pane and choose Project Properties.
Alternatively, to work with form and control Events, display the Properties for the required form or control in the Properties Pane - click on the form's background or on its name in the Forms Pane or select the control in the Workspace.
Locate the Events available under the Events Property category, in the Properties Pane.
Double-click on the Property value (i.e. <Create> or <Edit>) for one of the Event Properties or click on one of the Events and then choose the browse button, . This will display the Script Editor allowing you to create or edit a Script.
As a shortcut, you can display the Script Editor to work with form and control Events using Alt+left-click.