Page triggers are similar in operation and use to form triggers. Page triggers allow you to use C/AL code to control the behavior of the system as a result of an event on the page, such as a page opening or a field changing its value. You typically use page triggers for advanced validation and logic.
Page triggers can be divided into three categories:
-
General page triggers that apply to the entire page
-
Field page triggers that apply to a field control on a page
-
Action triggers that apply to an action on a page.
General Triggers
The following table lists triggers that apply to the entire page.
Page trigger name | Executed |
---|---|
When the page is loaded, but before the controls are available. |
|
When the page is initialized and the controls are available. |
|
When the page about to close and after OnQueryClosePage Trigger trigger. |
|
When the page is opened and a record is retrieved from a table. |
|
When the page changes from displaying one record to another record in a table. For example, on a Customer card page, this happens when a user selects Next (CTRL+PAGE DOWN) or Previous (CTRL+PAGE UP). |
|
When a record has been retrieved but not yet displayed. |
|
When a new record has been initialized but not yet displayed. |
|
When a new record is about to be inserted in the table. |
|
When a record is about to be modified in the table. |
|
When a record is about to be deleted from the table. |
|
When the page is about to close, but before the OnClosePage Trigger. |
Field Triggers
The following table describes the triggers that are available on field controls.
Control trigger | Executed |
---|---|
When the user changes the value in a field and then clicks away from the field so that the field loses focus. |
|
When the user requests a lookup by clicking a field's lookup button or pressing F4. |
|
When the user requests a drill-down by clicking the field's drill-down button or pressing SHIFT+F8. |
|
When the user requests assist-edit by clicking an AssistEdit button or by pressing SHIFT+F4. |
|
When a control add-in is initiated on a page. |
Action Triggers
The following table lists triggers that apply to actions on a page.
Triggers | Executed |
---|---|
When an action is initiated on a page. |