Namespaces in AL
Namespaces in AL cover how AL code is grouped into logical units to avoid naming conflicts and allow object name reuse. The section answers questions about namespace declaration, using directives, nested namespaces, scope resolution, and how to adopt namespaces in existing code with tooling.
- 2Learn pages
- 2videos
Path: Development > Programming in the AL language > Language elements > Namespaces in AL · tier official · system development · narrative reviewed (checked by Opus)
Overview
Namespaces in AL organize code into logical groups, prevent naming conflicts, and let the same object name be reused in different contexts. The concept page explains the core elements: declaring a namespace, the using directive, nested namespaces, and the scoping rules that resolve names.
The adoption page is for teams moving existing AL code to namespaces step by step. It describes automated code actions, namespace template resolution, sibling file analysis, a PowerShell script for adding namespaces in bulk, and sorting of using statements. It also covers fully qualified object references, which are supported from Business Central 2026 release wave 1.
Start with “Namespaces in AL” for the concepts and scoping rules. Then read “Adopting namespaces in AL” when you need to apply them to an existing codebase.
Key points
- Namespaces group code logically and prevent naming conflicts.
- Object names can be reused across different namespace contexts under defined scoping rules.
- Core language elements: namespace declaration, using directive, nested namespaces, scope resolution.
- Adoption can be progressive, not all at once.
- Automated code actions add namespaces, using namespace template resolution and sibling file analysis.
- A PowerShell script can add namespaces to many files in bulk.
- Using statements can be sorted automatically.
- Fully qualified object references are supported from Business Central 2026 release wave 1.
Learn pages
- Adopting namespaces in AL: Learn about features, tools, and best practices for structuring and adopting namespaces in your AL code for Business Central.
- Namespaces in AL: Namespaces in AL provide a way to organize your code into logical units and avoid naming conflicts.
Videos and posts
Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.
- Navigating Namespace Changes in Business Central 28 (community post): “Fully qualified names enable direct object reference without using statements”
- Business Central 2025 wave 2 (BC27): New field “AL Namespace” has been added to object metadata record (AllObj, AllObjWithCaption, Page Metadata, Report Metadata, and Codeunit Metadata) (community post): “new AL Namespace field in object metadata tables”
- Dynamics 365 Business Central: Where to find all standard AL namespaces? (Download all AL namespaces) (community post): “Namespaces organize code into logical groups and prevent naming conflicts”
- Business Central 2026 release wave 1 (BC28): Run AL objects and open record references using fully qualified names (Support for namespaces and fully qualified names) (community post): “support for namespaces and fully qualified names in AL, allowing developers to run”
- Business Central 2026 release wave 2 (BC29): Translate objects with the same name in different namespaces (Translations with namespaces) (community post): “namespace-aware translation identifiers that allow identically named AL objects”
- All new goodies about AL Namespace in BC 2025 wave 2 (video): “AL namespace; record id formatting; system reflection; fully qualified names”
- What’s New: Business Central Developer Tools (2023 release wave 2) (video): “Namespaces in AL language; Using directives for namespace imports; Namespace code actions”
Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.