The AL programming language
The AL programming language section covers language fundamentals for Business Central extensions: statements, methods, error handling, labels, access modifiers and XML comments. It also covers variables and types, object types, preprocessor directives and code analysis. It answers how to write, structure and extend AL code.
- 45Learn pages
- 4subtopics
- 1videos
Path: Development > The AL programming language · tier official · system development · narrative unreviewed (model text not yet checked)
Overview
This section documents AL, the language used to build Business Central extensions. The hub’s own pages cover the core constructs: simple and control statements, methods, complex return types, labels, access modifiers, error handling and XML comments. “Programming in AL” gives the general fundamentals, including variable declarations, triggers and code reuse.
Subtopics go deeper. Variables, types, and operators covers declaration, scoping, system variables such as Rec and CurrPage, operator precedence and type conversion. Objects describes each AL object type and how to extend it. Preprocessor directives covers conditional compilation, regions and pragmas. Code analysis is a further subtopic, but no summary of it was provided.
Start with “Programming in AL” for the basics, then move to the statements and methods pages. Use the Objects subtopic when working on a specific object type. The AL development environment reference overview and the FAQ help with object, property and trigger lookups and with tooling questions.
Key points
- Control statements: if-then-else, case, for, foreach, while and repeat-until.
- Simple statements: assignment (including compound assignment operators), method statements and AssertError for tests.
- Access modifiers (internal, local, protected, public) control visibility at compile time. The internalsVisibleTo setting is also covered.
- Error handling: error dialogs, try methods, error collection, the ErrorInfo data type and error telemetry.
- Labels are translatable string constants with Comment, Locked and MaxLength parameters, used for captions, tooltips and messages.
- Objects subtopic covers codeunits, tables, pages, queries, reports, XMLports, enums, control add-ins and permission sets.
- Preprocessor directives: #if/#else/#elif/#endif, #define/#undef, #region, and #pragma warning and implicitwith.
- XML comments with triple slashes enable IntelliSense and autogenerated documentation with ALDoc.
Subtopics
- Variables, types, and operators (8 pages)
- Objects (16 pages)
- Preprocessor directives in AL (3 pages)
- Code analysis (7 pages)
More Learn pages
- AL complex types: With AL complex types, you can return most types from procedures in AL for Business Central
- AL control statements: Compound, conditional, and repetitive control statements in AL for Business Central.
- AL development environment reference overview: Overview of the objects in the AL Language development environment.
- AL error handling: Deal with unexpected situations that occur when code is run in AL for Business Central.
- AL simple statements: Describes the simple, single-line statements in AL for Business Central with examples
- FAQ for Developing in AL: Overview of frequently asked questions for development using the AL language.
- Programming in AL: AL is the programming language used for manipulating data such as retrieving, inserting, and modifying records in a Business Central database. It controls the execution of the various application objects, such as pages, reports, or codeunits.
- Using Access Modifiers in AL: Describes how the AL access modifiers can be used in code.
- Working with AL methods: Methods also known as procedures are a fundamental programming element in AL for Business Central.
- Working with Labels in AL for Business Central: Learn how to work with labels in AL, the translatable string constants that Business Central displays as captions, descriptions, and messages.
- XML comments in code: Learn about adding documentation to AL code by including XML elements in a special syntax.
Videos and posts
Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.
- AL Language extension for Microsoft Dynamics 365 Business Central version 15.0.1433841 (New version) (community post): “The AL Language extension version 15.0 introduces implicit conversion between Record and RecordRef”
- What’s New: AL Language (2025 release wave 1) (video): “AL Language; resources; pages; reports; strings; json; yaml”
Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.
What Learn documents here 8 of 45 Learn pages
- learnAL complex types2024-03-01
- learnAL control statements2026-12-04
- learnAL development environment reference overview2025-05-14
- learnAL error handling2024-03-01
- learnAL operators2026-11-11
- learnAL Preprocessor Directives Overview2026-10-05
- learnAL simple statements2025-01-24
- learnAL type conversion in expressions2025-02-07
Show 32 more
- learnAL variables2026-11-11
- learnAppSourceCop analyzer2026-10-01
- learnArithmetic operators2024-07-01
- learnBoolean operators2024-07-01
- learnCodeCop analyzer2026-10-01
- learnCodeunit object2025-05-19
- learnControl add-in object2025-03-20
- learnEntitlement object2025-03-19
- learnExtensible Enums2025-05-21
- learnFAQ for Developing in AL2025-06-16
- learnPage customization object2025-08-19
- learnPage extension object2024-11-13
- learnPage object2024-04-26
- learnPermission Set Extension Object2026-11-30
- learnPermission set object2025-06-02
- learnPerTenantExtensionCop analyzer2026-10-01
- learnPragma Directives in AL Overview2026-10-05
- learnProfile object2024-09-30
- learnProgramming in AL2025-01-16
- learnProtected variables2024-05-24
- learnQuery object2024-11-22
- learnRegion Directives for Organizing AL Code2026-10-05
- learnRelational operators2024-04-26
- learnReport object2024-09-16
- learnRuleset for the code analysis tool2022-06-24
- learnSystem-defined variables2024-04-26
- learnTable extension object2024-04-17
- learnTable keys2026-09-22
- learnTable object2026-06-12
- learnUICop analyzer2026-10-01
- learnUsing Access Modifiers in AL2022-09-27
- learnUsing the code analysis tool2026-08-25