{"title":"ErrorInfo.Callstack() Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/errorinfo/errorinfo-callstack-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/errorinfo/errorinfo-callstack-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/errorinfo/errorinfo-callstack-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":"Specifies a callstack where the ErrorInfo was collected.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Syntax","slug":"syntax","at":117,"chars":123},{"level":2,"title":"Parameters","slug":"parameters","at":240,"chars":100},{"level":2,"title":"Return Value","slug":"return-value","at":340,"chars":104},{"level":2,"title":"Remarks","slug":"remarks","at":444,"chars":185},{"level":2,"title":"Example","slug":"example","at":629,"chars":275},{"level":2,"title":"Related information","slug":"related-information","at":904,"chars":217}],"text":"> Version: _Available or changed with runtime version 8.0._\nSpecifies a callstack where the ErrorInfo was collected.\n## Syntax\n```al\nCallstack :=   ErrorInfo.Callstack()\n```\n> NOTE\n> This method can be invoked using property access syntax.\n## Parameters\nErrorInfo\nType: errorinfo-data-type\nAn instance of the errorinfo-data-type data type.\n## Return Value\nCallstack\nType: ../text/text-data-type\nThe callstack where the ErrorInfo was collected.\n## Remarks\nWhen using the collectable errors feature, you might need the ErrorInfo.Callstack method to get AL stack traces for all errors collected while processing the list of errors.\n## Example\n```al\nprocedure myErrorHandlerProc( MyErrorInfo: ErrorInfo )\nvar\n    stackTrace: Text[2048];\nbegin\n    stackTrace := MyErrorInfo.Callstack();\n\n    // do something\nend\n```\nFor an elaborate example, see the ErrorMessageManagement codeunit in the system application.\n## Related information\nerrorinfo-data-type\nCollecting Errors<../../devenv-error-collection>\n../../devenv-al-error-handling\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}