{"title":"Working with and Troubleshooting Payloads","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-reports-troubleshoot-printing/","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/devenv-reports-troubleshoot-printing, 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/devenv-reports-troubleshoot-printing","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":"Dynamics 365 Business Central supports different types of events including BusinessEvent, IntegrationEvent, Global, and trigger events.","date":"2021-04-01","meta":{"topic":"troubleshooting-general"},"outline":[{"level":1,"title":"Working with and Troubleshooting Payloads","slug":"working-with-and-troubleshooting-payloads","at":0,"chars":3981},{"level":2,"title":"Troubleshooting printer payload errors","slug":"troubleshooting-printer-payload-errors","at":157,"chars":2627},{"level":3,"title":"Getting more information from the Windows Event Log","slug":"getting-more-information-from-the-windows-event-log","at":1004,"chars":841},{"level":3,"title":"Creating a printer selection page for testing","slug":"creating-a-printer-selection-page-for-testing","at":1845,"chars":939},{"level":2,"title":"Unpacking detailed views of the report payload","slug":"unpacking-detailed-views-of-the-report-payload","at":2784,"chars":1007},{"level":2,"title":"Related information","slug":"related-information","at":3791,"chars":190}],"text":"# Working with and Troubleshooting Payloads\nThis article provides some tips and tricks for working with and troubleshooting the printer and report payloads.\n## Troubleshooting printer payload errors\nIf a printer payload isn't valid, a runtime error occurs in the client when the OnAfterSetupPrinters event is raised. The details in the error message will depend on what action raised the OnAfterSetupPrinters event.\n If the error occurs from the Printer Selections page or the report request page, the following general error message appears:\n  'The data provided by the extension for a printer's setup is invalid. Please contact the developer of the extension for further assistance.'\n If the error occurs when opening a page that uses the virtual table Printer as its source, then a more detailed message displays, depending on the cause.\nRefer to the Printer Payload<devenv-onaftersetupprinters-event#printpayload> to see the possible error messages and to help you identify and resolve these issues.\n### Getting more information from the Windows Event Log\nIf you're running Business Central on-premises, you can use the Windows Event log get more information about printer payload issues than what appears in the client. With errors related to an incorrect payload format, a warning is also recorded in the Windows Event Log of the computer running the Business Central Server. This warning provides more details than what is shown in the client. For example, let's say the client displays the following message:\n'The provided payload for printer '{0}' isn't formatted correctly. Please update the payload and try again.'\nUsing event By Event Viewer, you would see a message like the following message:\n```\nMessage The provided payload for printer '{0}' isn't formatted correctly. Details: Required property 'version' not found in JSON.\n```\n### Creating a printer selection page for testing\nWhen a page that uses the Printers system table opens, the system raises the OnAfterSetupPrinters event the Printers system table. During development, it can be useful to create a page the uses this table as its source. Once you have the page, you can run it to quickly verify the printer payloads.\nFor example, the following code snippet creates a page that lists extension printer setups.\n```al\npage 50101 MyPrinterList\n{\n    PageType = List;\n    ApplicationArea = All;\n    UsageCategory = Lists;\n    SourceTable = Printer;\n\n    layout\n    {\n        area(Content)\n        {\n            repeater(GroupName)\n            {\n                field(ID; ID)\n                {\n                    ApplicationArea = All;\n\n                }\n\n                field(Payload; Payload)\n                {\n                    ApplicationArea = All;\n\n                }\n            }\n        }\n    }\n}\n```\n## Unpacking detailed views of the report payload\nYou might want to look at the views that are in the report payload. The following code snippet unpacks the views that are in a report payload into a message:\n```al\nprocedure DisplayFilterView(ObjectPayload: JsonObject)\nvar\n    ViewSize: Integer;\n    i: Integer;\n    DataItemViews: JsonToken;\n    ViewToken: JsonToken;\n    ViewTableId: JsonToken;\n    ViewName: JsonToken;\n    ViewValue: JsonToken;\nbegin\n    ObjectPayload.Get('filterviews', DataItemViews);\n        ViewSize := DataItemViews.AsArray().Count;\n\n        for i := 0 to (ViewSize - 1) do begin\n            DataItemViews.AsArray().Get(i, ViewToken);\n            ViewToken.AsObject().Get('name', ViewName);\n            ViewToken.AsObject().Get('tableid', ViewTableId);\n            ViewToken.AsObject().Get('view', ViewValue);\n            Message('Name = %1, tableid = %2, Value = %3', ViewName.AsValue().AsText(), ViewTableId.AsValue().AsText(), ViewValue.AsValue().AsText());\n        end;\nend;\n```\n## Related information\nDeveloping Printer Extensions<devenv-reports-printing>\ndevenv-reports-create-printer-extension\ndevenv-onafterdocumentprintready-event\ndevenv-onaftersetupprinters-event"}