AL language: Steps to set up for development

AL language: Steps to set up for development

AL language: Steps to set up for development

Does your application need new objects, extended standard objects, or custom business logic? Here is what you need to know about AL language.

What is AL language?

AL is an application programming language to create code for Microsoft Dynamics 365 Business Central. Programmers use the AL programming language to access, add, and modify records in a Dynamics 365 Business Central database.

It manages how different application objects are executed, such as pages, reports, or code units. 

A key feature of AL is the ability to build business rules that ensure the data in the database is accurate and consistent with the customer’s operations.

With the help of the AL language, you can move data across tables, such as from an items table to a ledger table, or the data from different tables can be displayed together into a single report or all on one page.

AL gives you the ability to manage object implementation and user interaction. There are also several built-in functions in the AL that you can use while creating code, but you can also create your unique functions. Once you begin using AL, the syntax of this language will resemble that of Pascal.

Getting started with AL 

Before developing your code in AL language for Business Central, you must set up your development environment. Then, use Visual Studio Code to write your AL code.

Steps to set up for development:

1.Sign up for (If one already has an account on Dynamics 365 Business Central)

2.Install Visual Studio Code – Visual Studio Code is the main code editor for Dynamics 365     Business Central development. It enables you to write and debug the code for the extensions in the AL language.

3.Launch Visual Studio Code, then select Extension Management to add Microsoft’s “AL Language” extension.

AL Language

Other extensions that can be downloaded for smooth processing

    • AL Extension Pack
    • AL CodeActions

4.Use the keyboard shortcut “Ctrl+Shift+P” to open the command palette. Now type the command “AL GO!” and choose a path to a new empty folder and the version to run.

5.Select Microsoft cloud sandbox as the server.

6.For authentication, a pop-up box will appear. Follow the link and enter your credentials.

7.Press F5 to deploy and run the extension on your online sandbox tenant.

Note- While deploying the extension on the sandbox, you might encounter an error that appears as follows:

It might be because you need to download the symbols. Symbols are stored in the “.alpackages” folder. Therefore, you must launch the “AL: Download Symbols” function in the Command Palette (Ctrl+Shift+P) to download them.

The compiler requires the symbol files to check whether the dependencies are accurate. In addition, metadata about other extensions is contained in the symbol files. The symbol files are downloaded and put in your project’s “./alpackages” folder.

Now let’s understand the code you have created and deployed on the sandbox environment.

pageextension 50100 CustomerListExt extends “Customer List”


    trigger OnOpenPage();


        Message(‘App published: Hello world’);



The first code you develop is a simple “Hello, World” programme.

On the “customer list page,” put the text “Hello World” on the screen. You have developed a “page extension” to accomplish this.

The first line tells about the following:

    • Type of object being created
    • ID of that object
    • Name of the object
    • Since it is an extension of a page, the “extends” keyword must be used to specify the name of the page object that it extends.

Next, you have “trigger,” which is a way of activating a specific set of code to be executed based on the action performed.

Syntax of using triggers in your code.

trigger OnWhatAction()


    myVar: type;


    //Your custom code here


The IntelliSense will show you all the available triggers if you press “ctrl + space” after the keyword “trigger.”

If you want your text to appear as soon as the “customer list page” loads, “OnOpenPage” is the appropriate trigger.

When writing a set of statements in AL, you can write them as a compound statement by enclosing them between the beginning and end keywords.



    <statement 1>;  


    <statement n>;  


In Al, each statement is separated by a semicolon. Unlike other programming languages, AL language uses a semicolon to denote the separation of statements rather than the end of a sentence.

Within the begin…end keywords, use the Message() method to display the text in a message window. You can display any text using the Message() method on the page.

The above was an example of “creating a page extension to display a message.” You can use page extensions to add more functionality, like adding a field to a “Card Page,” making a column visible on the “List Page,” etc. You can also make extensions for other objects like Table, Page, Report, CodeUnit, etc.

Summing up

The AL language is like any other language and is used to add functionality to the base application of Business Central with the help of extensions using VS Code. Having basic knowledge of Dynamics 365 Business Central and some understanding of programming concepts will make it easy to learn and understand.

Learn more about Microsoft Dynamics 365 Business Central by clicking here.

Article Name
AL language: Steps to set up for development
AL is an application programming language used to write code for Microsoft Dynamics 365 Business Central.
Publisher Name
BugendaiTech Pvt Ltd
Publisher Logo
Spread the updates

Leave a reply

Notice: Undefined index: position_on_screen in /home/tl2jq5v7asif/public_html/wp-content/plugins/mystickyelements/mystickyelements-front.php on line 203