{"title":"Rules and guidelines for AL code","url":"https://jonas-paprotka.de/docs/dev-itpro/compliance/apptest-overview/","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-overview, 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-overview","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":"Describing the steps you must go through to successfully submit your Dynamics 365 Business Central app to Marketplace.","date":"2023-04-11","meta":{"topic":"overview"},"outline":[{"level":1,"title":"Rules and guidelines for AL code","slug":"rules-and-guidelines-for-al-code","at":0,"chars":5845},{"level":2,"title":"Critical errors","slug":"critical-errors","at":402,"chars":380},{"level":2,"title":"Important errors","slug":"important-errors","at":782,"chars":168},{"level":2,"title":"Common pitfalls","slug":"common-pitfalls","at":950,"chars":4738},{"level":2,"title":"Related information","slug":"related-information","at":5688,"chars":157}],"text":"# Rules and guidelines for AL code\nThis page defines the rules and guidelines to follow when writing AL code in an extension package for Business Central. The rules and guidelines are grouped according to two importance levels: critical errors that must be resolved, and important errors that should be resolved. Errors that aren't resolved must include an explanation and justification for the error.\n## Critical errors\n Code uses encryption key functions such as ImportEncryptionKey, ExportEncryptionKey, CreateEncryptionKey, and DeleteEncryptionKey. (It's fine to use the Encrypt and Decrypt methods.)\n Code uses AssertError.\n External data connections don't properly handle sensitive data.\n It doesn't encrypt sensitive table data. (that is, credit card info, passwords, etc.).\n## Important errors\n Temporary files aren't cleaned up after use.\n Code uses codeunits that require printers to be selected.\n Code uses a specific time zone or locale.\n## Common pitfalls\nTo help you save time, we're sharing a list of the top 15 common pitfalls that regularly lead to app validation failures.\n1. Prefix/Suffix missing\n One of the app requirements is for you to reserve a prefix/suffix for your app. This is needed to ensure a healthy app ecosystem by avoiding collision amongst apps. This common failure occurs due to not setting your prefix/suffix in some or all required places. See Benefits and Guidelines for using a Prefix or Suffix<apptest-prefix-suffix>.\n2. DataClassification missing or set incorrectly\n Due to the requirements of privacy laws and regulations, fields of field class Normal must use the DataClassification property<../developer>, and its value must be different from ToBeClassified. This applies to fields in tables and table extensions. Use the AppSourceCop<../developer/devenv-using-code-analysis-tool> tool for detecting this.\n3. Required translation files missing\n There are many country/regions today that where Dynamics 365 Business Central is available, and that you can support as well with your app. For specifying extra languages, we no longer support Caption ML. You must use xliff translation files instead. See ../developer/devenv-work-with-translation-files.\n Microsoft provides a free translation tool that you can access from https://lcs.dynamics.com<https://lcs.dynamics.com>.\n To support a specific country/region, you must include a translation file per for each language code. For example, to support Switzerland, you must provide fr-CH, de-CH, and it-CH.\n4. Missing permission sets\n Your app must provide one or more permission sets so that users can use your app's functionality. Your app must never require the SUPER permission set.\n5. Permission errors\n For your app to be a good citizen in Dynamics 365 Business Central, permission errors must not appear unless it's a necessary reason for showing the error.\n It's acceptable to throw an error to a user that does not have your permission set marked and tries to access your page object.\n It isn't acceptable to throw an error to that same user trying to access Business Central pages in the base application, or to throw an error to a user who isn't trying to access your app's functionality.\n6. Missing application area tagging\n Tag in which part your app participates. Pages, controls, actions, and fields won't appear in Dynamics 365 Business Central if the Application Area property<../developer/properties/devenv-applicationarea-property> hasn't been set.\n7. Usage Category not set\n You enable a page or report to be available through search in Dynamics 365 Business Central by using the ../developer/properties/devenv-usagecategory-property. See Using Tell Me to Find Features and Information</ui-search>.\n8. OnCompany procedure\n Due to their performance impact, OnBeforeCompanyOpen and OnAfterCompanyOpen can't be used. See Replacing OnBeforeCompanyOpen and OnAfterCompanyOpen<apptest-onbeforecompanyopen>.\n9. Upgrade procedures\n Make sure that your app can be upgraded properly. See ../developer/devenv-upgrading-extensions.\n10. Profiles\n Don't insert into the Profile table. Use the ../developer/devenv-profile-object instead.\n11. App file not properly code-signed\n Your app file must be digitally signed with a certificate from a third-party certification authority trusted by Windows.\n12. You tested your app on an obsolete Dynamics 365 Business Central version (or never even tested it)\n Make sure that your app is properly tested on the correct version. See Current Build - Developing for Dynamics 365 Business Central<https://partner.microsoft.com/dashboard/collaborate/packages/4756> on the Collaborate site.\n13. You tested using SUPER permissions\n You tested your app, but your user had SUPER permissions. This can hide critical errors. You must test with a user that doesn't have the SUPER permissions. The user must have the ESSENTIAL license. See Testing your Extension<apptest-testingyourextension>.\n14. User scenario document unclear\n Our validation team is testing your app functionality manually, so we need to be able to understand the core functionality of your app. If your user scenario document is missing important details that are needed for us to properly walk through your app's setup and usage scenarios, we can't validate your app successfully. See User Scenario Documentation<apptest-userscenario>.\n15. The .json file is incorrect\n There are many values in the app.json file that may not be mandatory to compile your app, but are mandatory for your app to be in Marketplace. For example, your app can't be published to a production tenant if the target value is set to OnPrem. It must be set to Cloud. For information, see ../developer/devenv-json-files.\n## Related information\nBest practices for AL code<apptest-bestpracticesforalcode>\nChecklist for submitting your app<../developer/devenv-checklist-submission>"}