# Rules and guidelines for AL code
This 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.
## Critical errors
 Code uses encryption key functions such as ImportEncryptionKey, ExportEncryptionKey, CreateEncryptionKey, and DeleteEncryptionKey. (It's fine to use the Encrypt and Decrypt methods.)
 Code uses AssertError.
 External data connections don't properly handle sensitive data.
 It doesn't encrypt sensitive table data. (that is, credit card info, passwords, etc.).
## Important errors
 Temporary files aren't cleaned up after use.
 Code uses codeunits that require printers to be selected.
 Code uses a specific time zone or locale.
## Common pitfalls
To help you save time, we're sharing a list of the top 15 common pitfalls that regularly lead to app validation failures.
1. Prefix/Suffix missing
 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>.
2. DataClassification missing or set incorrectly
 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.
3. Required translation files missing
 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.
 Microsoft provides a free translation tool that you can access from https://lcs.dynamics.com<https://lcs.dynamics.com>.
 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.
4. Missing permission sets
 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.
5. Permission errors
 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.
 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.
 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.
6. Missing application area tagging
 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.
7. Usage Category not set
 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>.
8. OnCompany procedure
 Due to their performance impact, OnBeforeCompanyOpen and OnAfterCompanyOpen can't be used. See Replacing OnBeforeCompanyOpen and OnAfterCompanyOpen<apptest-onbeforecompanyopen>.
9. Upgrade procedures
 Make sure that your app can be upgraded properly. See ../developer/devenv-upgrading-extensions.
10. Profiles
 Don't insert into the Profile table. Use the ../developer/devenv-profile-object instead.
11. App file not properly code-signed
 Your app file must be digitally signed with a certificate from a third-party certification authority trusted by Windows.
12. You tested your app on an obsolete Dynamics 365 Business Central version (or never even tested it)
 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.
13. You tested using SUPER permissions
 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>.
14. User scenario document unclear
 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>.
15. The .json file is incorrect
 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.
## Related information
Best practices for AL code<apptest-bestpracticesforalcode>
Checklist for submitting your app<../developer/devenv-checklist-submission>

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. https://jonas-paprotka.de/docs/dev-itpro/compliance/apptest-overview/
