MSBA-352 · Lesson 1 of 12 · 22 min

The AL development environment

▶ Video coming soon A video version of this lesson is on the way.

Joss Varga-Mbatha joined Quarrystone Business Systems in September 2026 as a junior developer. Joss had written Python and a little C# at college, had used Business Central for one summer as an accounts clerk, and had never written a line of AL. Noor Haddad-Kessel, who had spent the autumn configuring Corbel & Finch Coffee Roasters for its January 1, 2027 go-live, became Joss's mentor. "You will learn AL on a real job," she said at their first session in early October. "Corbel & Finch has one gap that standard Business Central does not fill, and you are going to build the extension that fills it."

The gap came from Callum Rennick-Obi, the bookkeeper turned Business Central lead. Corbel & Finch sells espresso grinders and batch brewers to the wholesale cafés that buy its coffee. Each machine carries a manufacturer's serial number, tracked with the SN-WARRANTY item tracking code that Callum set up in the inventory course. Grinders come with a 24-month warranty and brewers with 12 months, and when a café calls about a broken burr set, someone digs through a spreadsheet to see whether the machine is still covered. Callum wanted every machine registered automatically when it ships, a list of warranties by customer and serial number, a simple claim log, and a certificate the café can keep. Business Central's Service Management module does some of this, but it needs the Premium license, and Corbel & Finch chose Essentials. A small extension was cheaper than nine Premium licenses.

This course follows Joss through that build. Each lesson adds a layer: tables, pages, code units, events, a report, a query and an API, enums and interfaces, permissions, debugging, and finally the full case study. This first lesson sets up the workbench.

What an extension is

Business Central is not customized by editing Microsoft's source code. Every change a partner makes is packaged as an extension: a set of AL objects compiled into a single .app file and installed on top of the base application. The base application, the System Application and the other Microsoft apps stay untouched. When Microsoft ships a monthly update or a major release, the extension stays in place, because it only adds to the product or reacts to it through published extension points.

AL is the language used to write those objects. It is a descendant of C/AL, the language of the old Dynamics NAV, with a modern syntax, a compiler that runs in Visual Studio Code, and strict rules about what an extension may change. AL describes both data and behavior: a table object defines fields and keys, a page object defines what users see, a codeunit holds procedures, and so on. Lesson 2 lists every object type.

Kinds of extensions. This course builds a per-tenant extension.
Kind of extensionWho builds itWhere it is installedExample
Per-tenant extension (PTE)A partner or an in-house developerOne customer's environments onlyThe Corbel & Finch warranty extension
Marketplace app (AppSource)An ISVAny customer who installs it from the marketplaceA shipping-label app sold to many companies
Development extensionA developer, from Visual Studio CodeA sandbox, for testingJoss's build published while coding
Microsoft appsMicrosoftEvery environmentSystem Application, Base Application

Noor drew the distinction that matters for Corbel & Finch. A per-tenant extension, or PTE, belongs to one customer. It uses object IDs from the range 50,000 to 99,999, it does not go through Microsoft's marketplace validation, and Quarrystone is responsible for keeping it working through every update. AppSource apps live under stricter rules, which the next course in this track covers along with deployment and pipelines.

The toolchain

Everything an AL developer needs runs in Visual Studio Code, Microsoft's free code editor, with the AL Language extension for Business Central installed from the Visual Studio Code Marketplace. The extension adds the AL compiler, syntax highlighting, IntelliSense, code snippets, the debugger and the commands that talk to Business Central. Joss installed both on a Quarrystone laptop in one morning.

A flow diagram. Visual Studio Code with the AL Language extension sits on the left. An arrow labeled download symbols comes from a Business Central environment into a .alpackages folder. An arrow labeled build goes from the AL source files to a compiled .app file. An arrow labeled publish goes from the .app file to two targets: an online sandbox and a local container sandbox. A dashed red arrow to a production environment is labeled not from the editor.
The AL toolchain: symbols come down, the compiled app goes up, and production is never a publish target from the editor.

Three operations make up the daily loop.

  • Download symbols. The compiler needs to know what already exists: every table, page and event in the base application. The command AL: Download Symbols fetches symbol packages from the connected environment into a .alpackages folder in the project. Without them, the editor underlines every reference to a standard object.
  • Build. Ctrl+Shift+B compiles the project. If there are no errors, the compiler writes a .app file named after the publisher, app name and version.
  • Publish. F5 builds, publishes the app to the environment in launch.json and starts the debugger. Ctrl+F5 publishes without debugging. Alt+Ctrl+F5 does a rapid application development publish, which sends only the objects that changed since the last full publish and is much faster on a large project.

Creating a project with AL: Go!

The command AL: Go! creates a new project. It asks for a folder and a target platform, then creates a minimal working extension: an app.json manifest, a .vscode/launch.json file that says where to publish, and a sample file, HelloWorld.al, containing a page extension that shows a message when the customer list opens. Joss ran it, chose the latest platform, and opened the generated files with Noor.

The sample HelloWorld.al file that AL: Go! creates. It extends a standard page rather than changing it.
namespace DefaultPublisher.HelloWorld;

using Microsoft.Sales.Customer;

pageextension 50100 CustomerListExt extends "Customer List"
{
    trigger OnOpenPage();
    begin
        Message('App published: Hello world');
    end;
}

Noor pointed out three things in those eleven lines. The namespace declaration at the top groups the file's objects under a name, and the using line imports the namespace where Microsoft keeps the customer objects, so the code can refer to "Customer List" without a full path. The pageextension object has an ID (50100), a name, and the standard page it extends. And the code never touches the Customer List page itself; it attaches a trigger that runs after the page opens. "That is the whole philosophy," Noor said. "We add, we subscribe, we never edit Microsoft's code."

A folder tree for the project CF-Warranty. It contains a .vscode folder with launch.json and settings.json, a .alpackages folder with Microsoft symbol packages, a src folder with subfolders Tables, Pages, Codeunits, Reports, Queries, Enums and Permissions, a Translations folder, and app.json at the root. Notes beside each item explain its purpose.
How Quarrystone lays out the warranty project. AL does not require a folder structure, but a consistent one helps reviewers.

AL does not care where files sit inside the project folder; the compiler reads every .al file it finds. Quarrystone's convention is one object per file, named after the object, inside a src folder with one subfolder per object type. A reviewer can then find the warranty registration table at src/Tables/CNFWarrantyRegistration.Table.al without searching.

Where the code runs: sandboxes and containers

An extension has to be published to a running Business Central to be tested. There are two kinds of development target, and Noor uses both.

Online and container sandboxes compared.
Online sandboxContainer sandbox
What it isA sandbox environment in the customer's Business Central online tenantBusiness Central running in a Docker container on a developer machine or a virtual machine
Who manages itMicrosoft runs it; admins create it in the admin centerThe partner, using its own scripts and tools
CostPart of the subscription, within the sandbox allowanceFree when local; hosting costs when in the cloud
DataCan be a copy of productionDemo data or RapidStart packages
Database accessNoYes, which helps when investigating data problems
Marketplace appsCan be installedNot available
Good forTesting with the customer's real setup and real usersFast, private, disposable development

Corbel & Finch has four environments from the foundations course: PROD, CONFIG, TRAINING and UPDATE-TEST. The three sandboxes use the whole sandbox allowance in the subscription, and Bettina Szczepanik was not going to pay for a fourth just for development. Noor's plan used what was already there. Joss develops every day in a container sandbox on a Quarrystone virtual machine, built from the same Business Central version as Corbel & Finch's tenant. When a feature is ready for Callum to try, Joss publishes it to UPDATE-TEST, which already holds a copy of the CONFIG setup with the SN-WARRANTY items.

Containers are created with Microsoft's PowerShell tooling from downloadable Business Central artifacts, the files that describe each version and country. Quarrystone has a script that builds a fresh container with one command, so a broken container is thrown away rather than repaired. Microsoft has announced that AL-Go for GitHub, its pipeline templates, is moving away from the older BcContainerHelper module, with official support there ending on October 1, 2027, so Noor keeps the container script small and replaceable.

Two rules about sandboxes caught Joss's attention. First, an extension published to an online sandbox from Visual Studio Code is a development extension, and it is removed when the environment is updated or relocated. After a Business Central update lands in UPDATE-TEST, Joss has to publish again. Second, publishing from Visual Studio Code to a production environment is not supported. Production receives the finished .app as a per-tenant extension through the admin tools, a process covered in the deployment course.

launch.json: telling the editor where to publish

The launch.json file holds one or more named configurations. Each says which server or environment to publish to, which object to open afterwards, and how the debugger should behave. Joss's file has two: one for the container and one for UPDATE-TEST.

Joss's launch.json with a container configuration and an online sandbox configuration.
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Container (local dev)",
            "type": "al",
            "request": "launch",
            "server": "http://cnf-dev",
            "serverInstance": "BC",
            "authentication": "UserPassword",
            "startupObjectType": "Page",
            "startupObjectId": 50101,
            "schemaUpdateMode": "Synchronize",
            "breakOnError": "All"
        },
        {
            "name": "UPDATE-TEST sandbox",
            "type": "al",
            "request": "launch",
            "environmentType": "Sandbox",
            "environmentName": "UPDATE-TEST",
            "startupObjectId": 50101,
            "schemaUpdateMode": "Synchronize",
            "breakOnError": "All"
        }
    ]
}
The launch.json settings Joss uses most.
SettingMeaning
requestlaunch publishes and runs; attach joins an existing session; snapshotInitialize starts snapshot debugging (lesson 11)
environmentType and environmentNameFor online targets: Sandbox and the name of the sandbox
server, serverInstance, authenticationFor a container or an on-premises server
startupObjectType and startupObjectIdThe page, table, report or query to open after publishing
schemaUpdateModeSynchronize keeps data when tables change; Recreate drops the extension's data; ForceSync forces changes through and can lose data
breakOnError and breakOnRecordWriteWhen the debugger stops on its own

Code analysis and settings

The AL Language extension includes code analyzers that check code beyond what the compiler requires. CodeCop enforces general AL guidelines, UICop checks page and user interface rules, PerTenantExtensionCop applies rules for per-tenant extensions, and AppSourceCop applies the stricter marketplace rules. Analyzers are switched on in the workspace settings file, and their warnings appear in the Problems panel as Joss types.

The .vscode/settings.json file that turns on the analyzers Quarrystone requires for every PTE.
{
    "al.enableCodeAnalysis": true,
    "al.codeAnalyzers": [
        "${CodeCop}",
        "${UICop}",
        "${PerTenantExtensionCop}"
    ],
    "al.ruleSetPath": "./quarrystone.ruleset.json"
}

A ruleset file can raise a rule from a warning to an error or switch off a rule the team has agreed to ignore. Quarrystone's ruleset turns a handful of CodeCop warnings into errors, so a build with those problems cannot even be published. Lesson 11 returns to analyzers as a debugging aid.

AI assistance in the editor

Joss asked whether GitHub Copilot would just write the extension. Noor's answer was practical. GitHub Copilot works in Visual Studio Code with AL files, and Microsoft now ships AL agent tools with the AL Language extension, which let Copilot in agent mode build the project, download symbols, search symbols, read diagnostics, publish to a sandbox and work with the debugger. The same tools are available outside the editor through an AL MCP server started from the command-line tool, so any agent that speaks the Model Context Protocol can use them.

"Use it," Noor said, "and review every line it gives you the way I review yours. It is good at boilerplate, like a list page for a table you just wrote. It is bad at knowing which event in the posting routine is the right one, because that needs understanding of the business." Quarrystone's rule is that AI-generated code goes through the same pull request review as any other code. Building Copilot features into an extension for end users, with the Copilot capability objects, belongs to the next course.

Worked problem

Setting up the workbench

Joss has a new laptop and access to a Quarrystone container and to Corbel & Finch's UPDATE-TEST sandbox. What steps get Joss from nothing to a published Hello World?

Show solution
  1. Install Visual Studio Code and the AL Language extension from the Marketplace.
  2. Run AL: Go!, choose an empty folder named CF-Warranty and the current platform.
  3. Edit launch.json so the first configuration points at the container and the second at the UPDATE-TEST sandbox.
  4. Run AL: Download Symbols. The .alpackages folder fills with the Microsoft symbol packages, and the red underlines disappear.
  5. Press F5 with the container configuration selected. The app builds, publishes, and the browser opens the customer list with the Hello world message.
  6. Add settings.json with the three analyzers and the Quarrystone ruleset, and commit the project to the Git repository.

Answer: Install tools, scaffold with AL: Go!, configure launch.json, download symbols, publish with F5, then add analyzers and commit.

Source control from day one

Before Joss wrote anything real, Noor created a Git repository for the project on Quarrystone's GitHub organization and made Joss commit the scaffolded project. Every change after that goes on a branch and reaches the main branch through a pull request that Noor reviews. Microsoft publishes AL-Go for GitHub, a set of repository templates with ready-made workflows for building, testing and deploying AL apps, with one template for per-tenant extensions and one for marketplace apps. Quarrystone will move the warranty repository onto the per-tenant template before go-live; how those pipelines work is a topic for the next course.

Noor's reasons were simple. A .app file is a build output, not a source of truth. If Joss's laptop died, the project had to be rebuilt from the repository in minutes. And a pull request is where a second person reads the code before Corbel & Finch ever runs it.

Versions and runtimes

Business Central ships two major releases a year, called release waves, and the version number climbs by one each time. The 2026 release wave 2, which Corbel & Finch runs, is version 29. Each version supports a matching AL runtime, which decides which language features the compiler allows. Version 29 brings runtime 18.0. The runtime is set in app.json (lesson 2), and an app built for a runtime can only be installed on that version of Business Central or later. Joss would later learn to set it deliberately: high enough for the features the code uses, and no higher than the oldest environment the app has to run on.

Common mistakes

  • MistakeTrying to change a standard page or table by editing Microsoft's code.

    InsteadExtend it with a page extension, table extension or event subscriber; the base application is never modified.

  • MistakeIgnoring the red underlines on standard objects and assuming the code is wrong.

    InsteadDownload symbols first; the compiler cannot see standard objects without them.

  • MistakeExpecting a development extension in an online sandbox to survive a Business Central update.

    InsteadRepublish after the sandbox is updated or relocated; development extensions are removed.

  • MistakeAdding a production configuration to launch.json to save time.

    InsteadProduction receives the finished .app as a per-tenant extension through the admin tools.

  • MistakeAccepting AI-generated AL without review.

    InsteadReview it like any code, in a pull request, with analyzers on.

Summary and key terms

  • Business Central is changed only through extensions: AL objects compiled into a .app that sits on top of the base application.
  • Visual Studio Code with the AL Language extension is the whole toolchain: download symbols, build, publish and debug.
  • AL: Go! scaffolds a project with app.json, launch.json and a sample file.
  • Online sandboxes test against real setup; container sandboxes give fast, private development.
  • launch.json says where to publish; production is never a publish target from the editor.
  • Code analyzers, source control and reviewed AI assistance are part of the workbench from day one.
Extension
A package of AL objects compiled into a .app file that adds to Business Central without changing its code.
Per-tenant extension
An extension built for one customer and installed only in that customer's environments.
Symbols
Packages describing existing objects, which the compiler needs to reference them.
Container sandbox
Business Central running in a Docker container, managed by the partner.
launch.json
The file that defines where and how Visual Studio Code publishes and debugs.
Code analyzer
A rule set, such as CodeCop or PerTenantExtensionCop, that checks AL code beyond the compiler.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Why did Corbel & Finch choose an extension rather than Service Management for warranties?

    Show answer

    Service Management needs the Premium license, and Corbel & Finch runs on Essentials; a small extension costs less than upgrading nine licenses.

  2. What do F5, Ctrl+F5 and Alt+Ctrl+F5 do?

    Show answer

    F5 builds, publishes and debugs; Ctrl+F5 publishes without debugging; Alt+Ctrl+F5 publishes only changed objects (rapid application development).

  3. Joss's extension vanished from UPDATE-TEST after a monthly update. Why, and what is the fix?

    Show answer

    Development extensions published from Visual Studio Code are removed when an online sandbox is updated; publish again.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz