{"title":"Page.GetBackgroundParameters() Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/page/page-getbackgroundparameters-method/","by":"JOP-AL","license":"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-getbackgroundparameters-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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/page/page-getbackgroundparameters-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Gets the page background task input parameters.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Syntax","slug":"syntax","at":108,"chars":67},{"level":2,"title":"Return Value","slug":"return-value","at":175,"chars":146},{"level":2,"title":"Remarks","slug":"remarks","at":321,"chars":677},{"level":2,"title":"Example","slug":"example","at":998,"chars":1017},{"level":2,"title":"Related information","slug":"related-information","at":2015,"chars":167}],"text":"> Version: _Available or changed with runtime version 4.0._\nGets the page background task input parameters.\n## Syntax\n```al\nParameters :=   Page.GetBackgroundParameters()\n```\n## Return Value\nParameters\nType: Dictionary of [Text, Text]<../dictionary/dictionary-data-type>\nThe input parameters of the page background task.\n## Remarks\nYou 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 page-enqueuebackgroundtask-method, 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.\nUse the ../system/system-evaluate-method to convert parameter values to the data types required for calculations.\n## Example\nThe 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 ../../devenv-page-background-tasks.\n```al\ncodeunit 50100 PBTWaitCodeunit\n{\n    trigger OnRun()\n    var\n        Result: Dictionary of [Text, Text];\n        StartTime: Time;\n        WaitParam: Text;\n        WaitTime: Integer;\n        EndTime: Time;\n    begin\n        if not Evaluate(WaitTime, Page.GetBackgroundParameters().Get('Wait')) then\n            Error('Could not parse parameter WaitParam');\n\n        StartTime := System.Time();\n        Sleep(WaitTime);\n        EndTime := System.Time();\n\n        Result.Add('started', Format(StartTime));\n        Result.Add('waited', Format(WaitTime));\n        Result.Add('finished', Format(EndTime));\n\n        Page.SetBackgroundTaskResult(Result);\n    end;\n}\n\n```\n## Related information\n../../devenv-page-background-tasks\npage-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}