{"title":"OnPageBackgroundTaskError (Page Extension) trigger","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/triggers-auto/pageextension/devenv-onpagebackgroundtaskerror-pageextension-trigger/","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/triggers-auto/pageextension/devenv-onpagebackgroundtaskerror-pageextension-trigger, 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/triggers-auto/pageextension/devenv-onpagebackgroundtaskerror-pageextension-trigger","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":"Runs when an error occurs in a page background task.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"OnPageBackgroundTaskError (Page Extension) trigger","slug":"onpagebackgroundtaskerror-page-extension-trigger","at":0,"chars":1131},{"level":2,"title":"Syntax","slug":"syntax","at":166,"chars":794},{"level":3,"title":"Parameters","slug":"parameters","at":336,"chars":624},{"level":2,"title":"Related information","slug":"related-information","at":960,"chars":171}],"text":"# OnPageBackgroundTaskError (Page Extension) trigger\n> Version: _Available or changed with runtime version 4.0._\nRuns when an error occurs in a page background task.\n## Syntax\n```al\ntrigger OnPageBackgroundTaskError(TaskId: Integer; ErrorCode: Text; ErrorText: Text; ErrorCallStack: Text; var IsHandled: Boolean)\nbegin\n    ...\nend;\n```\n### Parameters\nTaskId\nType: ../../methods-auto/integer/integer-data-type\nSpecifies the ID of the background task that was run.\nErrorCode\nType: ../../methods-auto/text/text-data-type\nSpecifies the severity level of the error that occurred.\nErrorText\nType: ../../methods-auto/text/text-data-type\nSpecifies the message that explains the error that occurred.\nErrorCallStack\nType: ../../methods-auto/text/text-data-type\nSpecifies the call stack for the error that occurred.\nIsHandled\nType: ../../methods-auto/boolean/boolean-data-type\ntrue indicates that the error has been handled; false indicates that it has not been handled.\n## Related information\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>\n../page/devenv-onpagebackgroundtaskerror-page-trigger"}