OnInit Trigger

Initializes the user-defined variables on the page.

Syntax

trigger OnInit()
begin
    ...
end;

Applies To

  • Pages

Remarks

The AL code in this trigger is run immediately after the variables are cleared and the page is loaded. This trigger cannot be used to access the controls on the page. You can change properties that are dynamic, including those properties that can only be changed when the page is opened.

After this trigger is executed, the OnOpenPage Trigger for pages is called. If an error occurs in the trigger code, then the page is closed.

Note

The OnInit trigger does not support calls to control add-in methods and properties because the trigger is invoked before the page is instantiated.

See Also

Triggers
Page and Action Triggers