Apart from the system events, you can define your own specific events called User-defined events.
A User-defined event triggers an action whenever a button or key is pressed, or when an Action is selected from the Action Bar.
The shortcut key combination associated with the User-defined event is optional. If no shortcut key is defined, the only way that the event is triggered is when the user presses the associated button.
Event user_defined_event_name [key ]
<code>
EndEvent
Where:
user_defined_event_name
Name of the user-defined event.
key
Number of function key associated with the event. Optional.
Event 'Create Supplier' 6
Supplier('INS',0)
refresh
EndEvent
This is a User-defined event called 'Create Supplier'. When this event is triggered (either by clicking a button associated with the event or by pressing F6), the Supplier Transaction object is called, passing two parameters to it. After the Transaction is executed, the Refresh command is executed. For example, if a Grid in the Web Panel displays a list of all suppliers, the Refresh command reloads the Grid after the Transaction is executed, ensuring that the newly inserted supplier is also displayed.
Event 'Supplier Receipts'
PrintReceipts.(SupplierId)
Endevent
The User-defined event 'Supplier Receipts' is triggered when the user clicks the button associated with the event. At that moment, the code defined within the event is executed. In this sample, 'PrintReceipts' object is called, with the instantiated SupplierId attribute passed as a parameter.
Objects: Transaction, Web Panel, Panel
Native Mobile Applications Events
Global Events