# 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
```al
 Page.SetBackgroundTaskResult(Results: Dictionary of [Text, Text])
```
## Parameters
Results
Type: Dictionary of [Text, Text]<../dictionary/dictionary-data-type>
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 ../dictionary/dictionary-add-method to populate the Results dictionary with the key-value pairs that you want to pass to calling page's ../../triggers-auto/page/devenv-onpagebackgroundtaskcompleted-page-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 ../../devenv-page-background-tasks.
```al
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;
}

```
## Related information
../../devenv-page-background-tasks
page-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/page/page-setbackgroundtaskresult-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/page/page-setbackgroundtaskresult-method/
