Page.SetBackgroundTaskResult(Dictionary of [Text, Text]) Method
Version: Available or changed with runtime version 4.0.
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.
Syntax
Page.SetBackgroundTaskResult(Results: Dictionary of [Text, Text])
Parameters
Results
Type: Dictionary of [Text, Text]
Specifies the dictionary of results for the page background task.
Remarks
You use this method in a page background task codeunit to pass the results of the page background task codeunit to the calling page. Before calling this method, use the Add method to populate the Results
dictionary with the key-value pairs that you want to pass to calling page's OnPageBackgroundTaskCompleted trigger. The OnPageBackgroundCompleted
trigger can then handle the results on the calling page, such as updating the record in the UI or database.
Example
The following code is an example of a page background task codeunit that uses the SetBackgroundTaskResult method to set a dictionary of results that will be passed to the calling page. 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 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기