{"title":"Restrictions on UI for objects exposed as web services","url":"https://jonas-paprotka.de/docs/dev-itpro/compliance/apptest-webservices/","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/compliance/apptest-webservices, 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/compliance/apptest-webservices","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":"Describes restrictions on UI for web services.","date":"2023-04-11","meta":{"topic":"how-to"},"outline":[{"level":1,"title":"Restrictions on UI for objects exposed as web services","slug":"restrictions-on-ui-for-objects-exposed-as-web-services","at":0,"chars":1851},{"level":2,"title":"Related information","slug":"related-information","at":1702,"chars":149}],"text":"# Restrictions on UI for objects exposed as web services\nPages and code units that are designed to be exposed as Web services must not generate any UI that would cause an exception in the calling code.\nSUMMARY AND INTENT: When writing code for Web services, you must not use end-user confirmation dialog boxes, message boxes, or any other page constructs in the code. Because a web service runs independently of a user interface, running this type of code causes the code to throw an exception. The exception can be caught and handled, but the web service won't complete.\nRESOURCES: See https://learn.microsoft.com/dynamics-nav/Microsoft-Dynamics-NAV-Web-Services-Overview.\nHOW TO COMPLY: Ensure that code for pages and code units that are being exposed as web services don't use any end-user confirmation dialog boxes or message boxes.\nTEST METHODOLOGY: To verify this requirement, the following tests will be performed:\n1. Identify the pages and code units that are exposed as web services during the installation of the extension.\n2. Using code inspection, verify that methods from the following table aren't used by the pages and code units published by the installation without conditional code that is based on GuiAllowed=false or CurrFieldNo=0 circumventing their call.\nAL Method|Applies to\nConfirm|Codeunit/page\nStrMenu|Codeunit/page\n(Page RunModal)|Page\nPage of type Confirmation Dialog|Page\n(Request page)|Page\nError|Codeunit/page\nBeep|Codeunit/page\nYield|Codeunit/page\nAdditionally, when running the page or code unit as a web service, the following exception should never occur:\nMicrosoft.Dynamics.Nav.Types.Exceptions.NavNCLCallbackNotAllowedException: Callback functions are not allowed.\n## Related information\nChecklist for submitting your app<../developer/devenv-checklist-submission>\nRules and guidelines for AL code<apptest-overview>"}