Page Data Type

Contains a number of simpler elements called controls. Controls are used to display information to the user or receive information from the user.

The following methods are available on the Page data type.

Method name Description
RunModal(Integer [, Record] [, Any]) Creates, opens, and closes a page that you specify. When a page is run modally, no input, such as a keyboard or mouse click, can occur except for objects on the modal page.
RunModal(Integer, Record, Integer) Creates, opens, and closes a page that you specify. When a page is run modally, no input, such as a keyboard or mouse click, can occur except for objects on the modal page.
RunModal(Integer, Record, FieldRef) Creates, opens, and closes a page that you specify. When a page is run modally, no input, such as a keyboard or mouse click, can occur except for objects on the modal page.
Run(Integer [, Record] [, Any]) Creates and launches a page that you specify. You can use CLEAR method to remove the page.
Run(Integer, Record, Integer) Creates and launches a page that you specify. You can use CLEAR method to remove the page.
SetBackgroundTaskResult(Dictionary of [Text, Text]) Sets the page background task result as a dictionary. When the task is completed, the OnPageBackgroundCompleted trigger will be invoked on the page with this result dictionary.
GetBackgroundParameters() Gets the page background task input parameters.

The following methods are available on instances of the Page data type.

Method name Description
Editable([Boolean]) Gets or sets the default editability of the page.
Caption([String]) The caption shown in the title bar. For example, the default value in English (United States) is the same as the name of the page.
LookupMode([Boolean]) Gets or sets the default lookup mode for the page.
ObjectId([Boolean]) Returns a string in the "Page xxx" format, where xxx is the caption or ID of the application object.
SaveRecord() Saves the current record as if performed by the client. If the record does not exist it is inserted, otherwise it is modified.
Update([Boolean]) Saves the current record and then updates the controls on the page. If you set the SaveRecord parameter to false, this method will not save the record before the page is updated.
GetRecord(var Record) Gets the current record of the page.
SetRecord(var Record) Sets the current record for the page.
SetTableView(var Record) Applies the table view on the current record as the table view for the page, report, or XmlPort.
SetSelectionFilter(var Record) Notes the records that the user has selected on the page, marks those records in the table specified, and sets the filter to "marked only".
Activate([Boolean]) Activates the current page on the client if possible. The data on the page will not be refreshed.
Close() Closes the current page.
RunModal() Creates, opens, and closes a page that you specify. When a page is run modally, no input, such as a keyboard or mouse click, can occur except for objects on the modal page.
Run() Creates and launches a page that you specify. You can use CLEAR method to remove the page.
EnqueueBackgroundTask(var Integer, Integer [, var Dictionary of [Text, Text]] [, Integer] [, PageBackgroundTaskErrorLevel]) Creates and queues a background task that runs the specified codeunit (without a UI) in a read-only child session of the page session. If the task completes successfully, the OnPageBackgroundTaskCompleted trigger is invoked. If an error occurs, the OnPageBackgroundTaskError trigger is invoked. If the page is closed before the task completes, or the page record ID on the task changed, the task is cancelled.
CancelBackgroundTask(Integer) Attempt to cancel a page background task.

See Also

Getting Started with AL
Developing Extensions