topic hubAL Developmentofficial - Microsoftreviewed - checked by Opus

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

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.

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.

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

What Learn documents here 8 of 340 Learn pages

Show 32 more