topic hubAL Developmentofficial - Microsoftunreviewed - model text not yet checked

Best practices

Best practices for developing Business Central extensions: AL code conventions, restrictions to avoid, testing, performance, security, telemetry, and connectivity app requirements. It answers how to write, test, instrument, secure, tune, and publish apps so they pass Marketplace validation.

Path: Development > Rules, guidelines, and best practices > Best practices · tier official · system development · narrative unreviewed (model text not yet checked)

Overview

This section collects guidance for building Business Central extensions that are clean, fast, secure, and ready for Marketplace submission. Most of it sits in five subtopics: AL code, Restrictions, Testing, Performance, and Security. Two pages sit directly in the hub: one on adding telemetry and one on requirements for connectivity apps.

Start with AL code for naming, file structure, formatting, prefix and suffix rules, and how to retire code with obsolete attributes. These rules can cause app validation failures. Then read Restrictions to avoid patterns such as UI in web service objects and the obsolete or deprecated company open events. Testing covers the Application Test Toolkit and the checks required before submission.

Performance and Security cover diagnosing bottlenecks, tuning, the layered security model, and Azure Key Vaults for secrets. The telemetry page explains how to add custom signals for production monitoring. The connectivity apps page applies only if you publish banking or external service connectivity apps.

Key points

  • AL code guidance covers naming, file structure, formatting, prefix and suffix rules, and deprecation with obsolete attributes and CLEAN symbols.
  • Restrictions: avoid UI in web service objects, and avoid the obsolete OnCompanyOpen event and the deprecated OnBeforeCompanyOpen and OnAfterCompanyOpen events, to prevent sign-in errors, login slowdowns and web service exceptions.
  • Testing uses the Application Test Toolkit, with a sample Customer Rewards extension showing test codeunits, UI handlers and mocking, plus pre-submission checks.
  • Performance pages explain how to measure and locate bottlenecks, then tune pages, web services, AL code, and data access.
  • Security covers authentication, authorization, encryption, auditing, change logging, and Azure Key Vaults for extension secrets.
  • Telemetry: add custom signals with LogMessage and SendTraceTag, send them to Application Insights or the Event Log, and use the Feature usage system module.
  • Connectivity apps listed in Business Central online must meet requirements including app compatibility, 85% test coverage, sales volume thresholds, and regulatory compliance such as PSD2 licensing (2022 release wave 2).

Subtopics

More Learn pages

Videos, posts and code changes

Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.

Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.

What Learn documents here 8 of 16 Learn pages

Show 8 more