---
id: topic/dev-itpro/development/rules-guidelines-and-best-practices
type: topic
title: Rules, guidelines, and best practices
summary: "Rules, guidelines, and best practices for Business Central extension development: how to obsolete AL objects, methods and symbols, how to deprecate external business events, and a Best practices subtopic on AL conventions, testing, performance, security, telemetry and Marketplace preparation."
tier: official
language: en
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-07T02:17:29.632Z"
  flags: []
generated:
  at: "2026-10-08T06:31:25.130Z"
  pipeline: 0.2.0
  prompts:
    hub-topic: 1
  input_hash: 14d9a2d160f457bd5b6c0b4062ac6e0f17c2112b4cdc6f8bf73d2fbbbf2d11a9
evidence:
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-app-key-vault-overview
    title: Azure Key Vaults with Business Central
    date: "2021-04-01"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/compliance/apptest-webservices
    title: Be careful about UI for web services
    date: "2023-04-11"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/compliance/apptest-bestpracticesforalcode
    title: Best practices for AL code
    date: "2026-02-19"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-deprecation-guidelines
    title: Best Practices for Deprecation of AL Code
    date: "2024-04-30"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-extension-advanced-example
    title: Building an Advanced Sample Extension
    date: "2022-12-29"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-deprecate-external-business-events
    title: Deprecate external business events
    date: "2025-07-02"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-instrument-application-for-telemetry
    title: Developing telemetry into your Business Central application
    date: "2024-02-09"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/performance/performance-work-perf-problem
    title: How to work with a performance problem
    date: "2026-09-18"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/security/security-application
    title: Layered security model in Business Central
    date: "2025-11-19"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-oncompanyopencompleted
    title: Moving from OnCompanyOpen
    date: "2022-05-23"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-obsolete-objects
    title: Obsolete objects, methods, and symbols in AL
    date: "2025-08-20"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/performance/performance-developer
    title: Performance Articles for AL Developers
    date: "2026-09-18"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/compliance/apptest-prefix-suffix
    title: Prefix and suffix for naming in extensions
    date: "2023-04-11"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/compliance/apptest-onbeforecompanyopen
    title: Replacing OnBeforeCompanyOpen and OnAfterCompanyOpen
    date: "2024-05-01"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/compliance/connectivity-apps-requirements
    title: Requirements for connectivity apps
    date: "2023-05-23"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/compliance/apptest-overview
    title: Rules and guidelines for AL code
    date: "2023-04-11"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-extension-advanced-example-test
    title: Test the advanced sample extension
    date: "2026-03-16"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/compliance/apptest-testingyourextension
    title: Testing your extension
    date: "2023-04-11"
    commit: null
    t: null
    quote: null
  - kind: learn
    url: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/compliance/apptest-userscenario
    title: User scenario documentation
    date: "2023-04-11"
    commit: null
    t: null
    quote: null
links:
  learn:
    - https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-deprecate-external-business-events
    - https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-obsolete-objects
  objects: []
  features: []
  topics:
    - topic/dev-itpro/development
    - topic/dev-itpro/development/rules-guidelines-and-best-practices/best-practices
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/10878
    - change/bcapps/11036
    - change/bcapps/9865
    - change/bcapps/9905
    - change/bcquality/146
    - change/bcquality/153
    - change/bcquality/156
    - change/bcquality/157
learn_toc_path:
  - Development
  - Rules, guidelines, and best practices
toc_file: dev-itpro/TOC.md
parent: topic/dev-itpro/development
children:
  - topic/dev-itpro/development/rules-guidelines-and-best-practices/best-practices
coverage:
  learn: 19
  code: 0
  video: 0
  blog: 0
  guideline: 0
bc_forms: []
member_hash: c1346913c56660145a86c78df755f50dc9b2260b080b9fdd9b7870929fed1757
narrative: generated
---

# Rules, guidelines, and best practices

> Rules, guidelines, and best practices for Business Central extension development: how to obsolete AL objects, methods and symbols, how to deprecate external business events, and a Best practices subtopic on AL conventions, testing, performance, security, telemetry and Marketplace preparation.

Path: [Development](../development.md) > Rules, guidelines, and best practices · tier official · system development · narrative reviewed (checked by Opus)

## Overview

This section collects the rules developers follow when building and maintaining Business Central extensions. Two pages sit directly in the hub and deal with lifecycle changes. One covers marking AL objects, methods and symbols as obsolete. The other covers deprecating external business events so that integrations are informed and move to replacement events.

The Best practices subtopic (17 pages) covers the wider craft: AL code conventions and restrictions, testing, performance, security, telemetry, connectivity app requirements and documenting user scenarios. It also helps with preparing an extension for Marketplace validation.

Start with the obsolete AL page if you need to retire code in an extension. Use the external business events page if the change affects outside integrations. Go to Best practices for general questions on writing, testing, securing and publishing extensions.

## Key points

- Obsoleting in AL uses the ObsoleteState, ObsoleteReason and ObsoleteTag properties or the [Obsolete] attribute.
- Analyzer rules enforce obsoletion, and preprocessor directives are part of the obsoletion guidance.
- External business events are deprecated by first marking them obsolete pending, then removing them in a future version.
- Deprecating an external business event involves the Obsolete and ExternalBusinessEvent attributes, a DisplayName prefix and event versioning. The page references version 27.0.
- The deprecation process is meant to keep external integrations informed and moving to replacement events.
- Best practices (17 pages) covers AL code conventions, restrictions, testing, performance, security and telemetry.
- Best practices also covers connectivity app requirements, user scenario documentation and preparing for Marketplace validation.

## Subtopics

- [Best practices](rules-guidelines-and-best-practices/best-practices.md) (17 pages)

## More Learn pages

- [Deprecate external business events](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-deprecate-external-business-events): Learn how to deprecate external business events in AL for Business Central.
- [Obsolete objects, methods, and symbols in AL](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-obsolete-objects): Description of how you use the obsoletion properties and attributes to obsolete an object, a method, or other symbols used in AL for Business Central.

## Videos, posts and code changes

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

- [#10878 Ruleset hardening: promote five low-risk rules to Error](../../../changes/bcapps/10878.md) (code change): "Ruleset hardening: promote five low-risk rules to Error"
- [#11036 Ruleset hardening: promote four compatibility rules to Error](../../../changes/bcapps/11036.md) (code change): "Pragmas are narrowly scoped to actual violations found in analyzer diagnostics"
- [#9865 [Main] - 'Greater Than' Withholding Tax Calculation Rule is not app…](../../../changes/bcapps/9865.md) (code change): "The withholding tax calculation now respects the configured calculation rule"
- [#9905 [Bug][SubscriptionBilling] Contract lines of type G/L Account never post to the selected G/L account](../../../changes/bcapps/9905.md) (code change): "Contract lines of type G/L Account now post to the G/L account specified on the line"
- [#146 knowledge: three false-positive guards from BCApps PR 10277, 10278 and 10346](../../../changes/bcquality/146.md) (code change): "AppSource affix requirement now correctly scoped to apps with AppSourceCop enabled"
- [#153 Promote knowledge for Microsoft-owned review skills](../../../changes/bcquality/153.md) (code change): "Moves 29 knowledge articles and 56 companion samples used by Microsoft-endorsed review skills"
- [#156 18 AL/BC patterns: style, data-modeling, web-services, appsource, breaking-changes, performance, testing](../../../changes/bcquality/156.md) (code change): "Adds 17 AL/BC knowledge articles with good and bad samples across style, data modeling, web services"
- [#157 18 more AL/BC patterns: data-modeling, testing, style, security, error-handling, ui, upgrade, web-services, appsource](../../../changes/bcquality/157.md) (code change): "BCQuality adds 18 new knowledge articles covering data modeling, testing, style, security, error handling"

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