Programming in the AL language
Programming in the AL language covers the language fundamentals for Business Central extensions: variables, triggers, operators, and code reuse. It also links to subtopics on tables, pages, reports, events, APIs, security, error handling, telemetry, background processing and external calls. Use it for AL syntax and how-to questions.
Path: Development > Programming in the AL language · tier official · system development · narrative reviewed (checked by Opus)
Overview
This section starts with the “Programming in AL” page, which describes the language basics: manipulating data, controlling application objects, creating business rules, and writing code in triggers on tables, pages, reports and other objects. It touches on variable declarations, protected variables, trigger types, code reuse and security patterns.
The subtopics go deeper. Program building blocks covers operators, statements, system-defined variables, access modifiers and XML comments. Language elements is the largest subtopic at 78 pages. Object-specific areas are tables and data, pages and the user interface, and reports. Cross-cutting areas are events, error handling, formatting values, security, telemetry, background processing, APIs and calling external services.
Start with the Programming in AL page and Program building blocks for syntax. Then go to the subtopic that matches your object or task. Device access, printer extensions and .NET interoperability (on-premises only) are narrower topics for specific scenarios.
Key points
- The Programming in AL page covers variable declarations, protected variables, trigger types, code reuse and security patterns.
- Program building blocks covers operators, statements, system-defined variables, access modifiers and XML comments.
- Error handling covers try methods, collectible errors, actionable errors with Fix-it and Show-it actions, and error telemetry.
- Tables and data covers records, queries, FlowFields, SIFT and NCCI indexing, XMLport and Excel import/export, number sequences and DataTransfer.
- Events covers publishing, raising and subscribing, isolated events, and discovering events with Event Recorder, so you can extend behavior without changing the original code.
- Developing APIs covers REST/OData v4 services built with API pages (read-write) and API queries (read-only).
- Background processing covers the job queue, page background tasks and the task scheduler, with limits for background and child sessions.
- Security covers permission sets, entitlements, Azure Key Vault, Isolated Storage and the SecretText data type.
Subtopics
- Program building blocks (6 pages)
- Language elements (78 pages)
- Error handling (16 pages)
- Formatting values (3 pages)
- Tables and data (56 pages)
- Pages and the user interface (69 pages)
- Developing reports (54 pages)
- Events (11 pages)
- Handling security (22 pages)
- Running things in the background (7 pages)
- Developing APIs (10 pages)
- Calling external services (8 pages)
- Instrumenting with telemetry (8 pages)
- Accessing device capabilities (2 pages)
- Developing printer extensions (2 pages)
- Using .NET (on-premises only) (5 pages)
More Learn pages
- 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.
Videos, posts and code changes
Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.
- #11507 [Master] Fix Unix timestamp timezone conversion (code change): “Unix timestamp conversion in TypeHelper now delegates to”
- #195 Add foundational AL developer knowledge (code change): “Add foundational AL developer knowledge. Adds seven foundational AL knowledge articles”
- What’s New: Data Search Improvements (For Developers) (2024 release wave 2) (video): “Modern search; full-text search; optimized for text search property”
- What’s New in AL: Embedding Resources in Applications (2024 release wave 2) (video): “Embedding resources in applications; get resource function; Multiple resource folders”
Business Central pages and reports
The pages, reports and queries this hub’s Learn pages name (ms.search.form, API reference), joined to the code by exact object id (data/index/docs-objects.json); a page shows the table it runs on.
- Page 16 “Chart of Accounts” · on Table 15 “G/L Account” · via Tables and data
- Page 21 “Customer Card” · on Table 18 “Customer” · via Developing reports
- Page 22 “Customer List” · captioned “Customers” · on Table 18 “Customer” · via Tables and data
- Page 25 “Customer Ledger Entries” · on Table 21 “Cust. Ledger Entry” · via Tables and data
- Page 26 “Vendor Card” · on Table 23 “Vendor” · via Tables and data
- Page 27 “Vendor List” · captioned “Vendors” · on Table 23 “Vendor” · via Tables and data
- Page 31 “Item List” · captioned “Items” · on Table 27 “Item” · via Tables and data
- Page 143 “Posted Sales Invoices” · on Table 112 “Sales Invoice Header” · via Tables and data
- Page 144 “Posted Sales Credit Memos” · on Table 114 “Sales Cr.Memo Header” · via Tables and data
- Page 456 “No. Series” · on Table 308 “No. Series” · via Tables and data
- Page 457 “No. Series Lines” · on Table 309 “No. Series Line” · via Tables and data
- Page 458 “No. Series Relationships” · on Table 310 “No. Series Relationship” · via Tables and data
- Page 459 “Sales & Receivables Setup” · on Table 311 “Sales & Receivables Setup” · via Tables and data
- Page 460 “Purchases & Payables Setup” · on Table 312 “Purchases & Payables Setup” · via Tables and data
- Page 461 “Inventory Setup” · on Table 313 “Inventory Setup” · via Tables and data
- Page 2650 “Email Printer Settings” · on Table 2650 “Email Printer Settings” · via Developing reports
- Page 2750 “Universal Printer Settings” · on Table 2751 “Universal Printer Settings” · via Developing reports
- Page 2752 “Add Universal Printers Wizard” · captioned “Add Universal Print Printers” · via Developing reports
- Page 2753 “Universal Print Shares List” · captioned “Print Shares” · on Table 2752 “Universal Print Share Buffer” · via Developing reports
- Page 2754 “Universal Printer Tray List” · captioned “Universal Printer Trays” · on Table 823 “Name/Value Buffer” · via Developing reports
- Page 8900 “Administrator Main Role Center” · captioned “Administrator Role Center” · via Developing reports
- Page 9300 “Sales Quotes” · on Table 36 “Sales Header” · via Tables and data
- Page 9301 “Sales Invoice List” · captioned “Sales Invoices” · on Table 36 “Sales Header” · via Tables and data
- Page 9303 “Blanket Sales Orders” · on Table 36 “Sales Header” · via Tables and data
- Page 9304 “Sales Return Order List” · captioned “Sales Return Orders” · on Table 36 “Sales Header” · via Tables and data
- Page 9305 “Sales Order List” · captioned “Sales Orders” · on Table 36 “Sales Header” · via Tables and data
- Page 9306 “Purchase Quotes” · on Table 38 “Purchase Header” · via Tables and data
- Page 9307 “Purchase Order List” · captioned “Purchase Orders” · on Table 38 “Purchase Header” · via Tables and data
- Page 9309 “Purchase Credit Memos” · on Table 38 “Purchase Header” · via Tables and data
- Page 9310 “Blanket Purchase Orders” · on Table 38 “Purchase Header” · via Tables and data
- Page 9311 “Purchase Return Order List” · captioned “Purchase Return Orders” · on Table 38 “Purchase Header” · via Tables and data
- Page 9650 “Custom Report Layouts” · on Table 9650 “Custom Report Layout” · via Developing reports
- Page 9652 “Report Layout Selection” · on Table 9651 “Report Layout Selection” · via Developing reports
- Page 9660 “Report Layouts” · via Developing reports
- Page 9666 “Report Theme and Header/Footer” · captioned “Manage themes and header-footer layouts” · via Developing reports
- Page 9882 “Report Res. Govern. Settings” · captioned “Report Limits and Settings” · via Developing reports
Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.
What Learn documents here 8 of 340 Learn pages
- learn.NET control add-ins2025-01-07
- learn(automation API) Get permissionSet2024-05-31
- learn(Obsolete) Create and modify custom report layouts2025-03-12
- learn(Obsolete) Import and Export Custom Report Layouts2021-04-01
- learn(Obsolete) Set the Layout Used by a Report2022-03-07
- learn(Obsolete) Update Custom Report Layouts2021-06-24
- learnAccessing Columns of a Query Dataset2024-04-29
- learnAction bar improvements2025-05-15
Show 32 more
- learnActionable errors2026-06-29
- learnActions in the user interface2025-01-07
- learnActions overview2025-05-15
- learnAdd FactBoxes to Business Central Pages2026-10-06
- learnAdd Menus to Role Center Navigation2026-10-06
- learnAdd pages and reports to Tell me2025-05-15
- learnAdd Tooltips to Table and Page Fields2026-10-06
- learnAdding actions to a page2025-11-14
- learnAdding barcodes to reports2021-04-06
- learnAdopting namespaces in AL2026-06-09
- learnAggregating data in query objects2024-05-03
- learnAL complex types2024-03-01
- learnAL control statements2025-03-26
- learnAL database methods and performance on SQL Server2025-04-01
- learnAL development environment reference overview2025-05-14
- learnAL error handling2024-03-01
- learnAL operators2024-09-18
- learnAL Properties Overview for Business Central2026-10-01
- learnAL simple statements2025-01-24
- learnAnalyze list page and query data using data analysis2026-09-18
- learnAnalyzing Error Message Vote Telemetry | Microsoft Docs2022-03-22
- learnAnalyzing Permission Changes Trace Telemetry2021-04-01
- learnAnalyzing permission dependency cycle trace telemetry2023-12-20
- learnAnalyzing Permission Error Trace Telemetry2022-07-27
- learnAPI developer overview2025-02-07
- learnAPI page type2026-09-21
- learnAPI query type2026-09-21
- learnApp Key Vault Secret Trace Telemetry | Microsoft Docs2025-09-25
- learnArrange Fields Using Grid Control2023-02-06
- learnArranging Fields in Rows and Columns Using a fixed Control2023-02-06
- learnArray Data Type and Methods in AL2026-10-05
- learnAssign document layouts to customers or vendors2024-11-28