Page.GetBackgroundParameters() Method
Version: Available or changed with runtime version 4.0.
Gets the page background task input parameters.
Syntax
Parameters := Page.GetBackgroundParameters()
Return Value
Parameters
Type: Dictionary of [Text, Text]
The input parameters of the page background task.
Remarks
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.
Example
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()
var
Result: Dictionary of [Text, Text];
StartTime: Time;
WaitParam: Text;
WaitTime: Integer;
EndTime: Time;
begin
if not Evaluate(WaitTime, Page.GetBackgroundParameters().Get('Wait')) then
Error('Could not parse parameter WaitParam');
StartTime := System.Time();
Sleep(WaitTime);
EndTime := System.Time();
Result.Add('started', Format(StartTime));
Result.Add('waited', Format(WaitTime));
Result.Add('finished', Format(EndTime));
Page.SetBackgroundTaskResult(Result);
end;
}
See Also
Page Background Tasks
Page Data Type
Get Started with AL
Developing Extensions
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기