Page.GetBackgroundParameters Method

Version: Available or changed with runtime version 4.0.

Gets the page background task input parameters.


Parameters :=   Page.GetBackgroundParameters()

Return Value

‚ÄÉType: Dictionary of [Text, Text]
The input parameters of the page background task.


You use this method in a page background task codeunit, which is the codeunit that runs in a page background task. When a page background task is enqueued by the EnqueueBackgroundTask, it can include a set of parameters (a collection of key and value pairs) that can be used in the computations done in the background task codeunit. These parameters are passed as a dictionary of text to the codeunit's OnRun trigger when the page background task session is started. You use the GetBackgroundParameters method to retrieve these parameters.

Use the Evaluate method to convert parameter values to the data types required for calculations.


The following code is an example of a page background task codeunit that uses the GetBackgroundParameters method to retrieve the value of the key named Wait, which is passed to the OnRun trigger from the calling page when the page background task is enqueued. For more details about this example, see Page Background Tasks.

codeunit 50100 PBTWaitCodeunit
    trigger OnRun()
        Result: Dictionary of [Text, Text];
        StartTime: Time;
        WaitParam: Text;
        WaitTime: Integer;
        EndTime: Time;
        if not Evaluate(WaitTime, Page.GetBackgroundParameters().Get('Wait')) then
            Error('Could not parse parameter WaitParam');

        StartTime := System.Time();
        EndTime := System.Time();

        Result.Add('started', Format(StartTime));
        Result.Add('waited', Format(WaitTime));
        Result.Add('finished', Format(EndTime));


See Also

Page Background Tasks
Page Data Type
Getting Started with AL
Developing Extensions