OnInit (Request Page) trigger

Version: Available or changed with runtime version 1.0.

Initializes the user-defined variables on the page.

Syntax

trigger OnInit()
begin
    ...
end;

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.

Get Started with AL
Developing Extensions
OnInit (Page) Trigger