AL Development: A Guide to Microsoft’s Modern Business Central Language

Share This Post

AL development is at the root of customizing and extending Microsoft Dynamics 365 Business Central, a powerful ERP solution for businesses. This post explores the AL language, its history, key features, and how it compares to other programming languages like C/AL, C#, and JavaScript. Whether you’re a developer or a business owner, understanding AL development can unlock tailored solutions for your organization.

AL is the programming language used to develop extensions and customizations for Microsoft Dynamics 365 Business Central, a cloud-based ERP platform. Introduced as part of Microsoft’s shift to a modern, cloud-first architecture, AL development enables developers to create apps, modify business logic, and integrate with external systems. Unlike its predecessor, C/AL, AL is designed for extensibility, scalability, and seamless integration with Visual Studio Code.

AL was introduced in 2016 with the release of Dynamics 365 Business Central. Microsoft phased out C/AL, the language used in the older Dynamics NAV, to align with modern development practices. AL development was born to support cloud and on-premises deployments, leveraging Visual Studio Code and the AL Extension for a streamlined developer experience. By 2018, AL became the standard for Business Central customizations, proving that Microsoft is focusing on modular, app-based extensions over monolithic codebases.

AL is built for ERP customization, offering features that make it developer-friendly and efficient. Here are its main components:

  1. Event-Based Architecture: AL uses events (e.g., OnBefore or OnAfter) to modify behavior without altering core code, ensuring not only clean upgrades but integration of custom business logic with base business logic.
  2. Extension Model: AL development focuses on extensions, self-contained apps that extend Business Central without modifying base objects.
  3. Integration with Visual Studio Code: AL leverages IntelliSense, debugging, and Git integration in VS Code, enhancing productivity.
  4. Table and Page Objects: AL simplifies data modeling with tables (for data storage) and pages (for user interfaces).
  5. AL Language Extension: The AL Language extension in VS Code provides syntax checking, code snippets, and deployment tools.
  6. Cloud and On-Premises Support: AL apps work across deployment models, offering flexibility for businesses.

These features make AL development intuitive for building robust, maintainable ERP solutions.

To understand AL’s strengths, let’s compare it to C/AL, C#, and JavaScript, highlighting similarities and differences.

  • Similarity: Both are used for Dynamics NAV/Business Central and share similar syntax for business logic (e.g., triggers).
  • Difference: C/AL relies on proprietary NAV development environments and modifies core objects, risking upgrade conflicts. AL development uses extensions, ensuring clean upgrades and cloud compatibility.
  • Example: Modifying a sales order requires editing the core Sales Order (Sales Header).
C/AL:
SalesHeader.MODIFY

AL:

[EventSubscriber(ObjectType::Table, Database::"Sales Header", 'OnAfterInsertEvent', '', true, true)]
procedure AddCustomField(var Rec: Record "Sales Header")
begin
    Rec."Custom Field" := 'New Value';
    Rec.Modify();
end;
  • Similarity: Both use structured programming and support object-oriented concepts like objects, classes, encapsulation, inheritance, polymorphism, abstraction.
  • Difference: C# is a general-purpose language for .NET applications, while AL is domain-specific for Business Central. AL development is simpler for ERP tasks but less versatile for non-ERP projects.
  • Example: Creating a class for a custom API.

C#:

public class Customer
{
    public string Name { get; set; }
    public void Save() { /* API logic */ }
}

AL:

tableextension 50100 CustomerExt extends Customer
{
    fields
    {
        field(50100; "Loyalty Points"; Integer)
        {
            Caption = 'Loyalty Points';
        }
    }
}
  • Similarity: Both support modern development environments (VS Code) and can integrate with web services.
  • Difference: JavaScript is ideal for web development, while AL focuses on ERP logic. AL’s event-driven model is tailored for business processes, unlike JavaScript’s client-side focus.
  • Example: Fetching data from an API.

Javascript:

fetch('api/customers')
    .then(response => response.json())
    .then(data => console.log(data));

AL:

procedure GetCustomerData()
var
    Customer: Record Customer;
begin
    Customer.FindSet();
    repeat
        Message(Customer.Name);
    until Customer.Next() = 0;
end;

AL development IS the tool to customize your Dynamics 365 Business Central. Its event-driven model, extension-based architecture, and tight integration with VS Code make it ideal for creating scalable, upgrade-safe customizations. Compared to C/AL, AL is future-proof; compared to C# or JavaScript, it’s specialized for ERP tasks, reducing complexity for business logic.

When looking at the tools you have available for a non-ERP project, you have choices, .NET, Javascript, PHP. And maybe you would be able to emulate the needed functionality inside Business Central using AL.

When looking at customizing your Business Central, you don’t have many options. AL is the only tool.

  1. Set Up Your Environment: Install Visual Studio Code and the AL Language extension.
  2. Create an Extension: Use the AL: Go! command in VS Code to scaffold a new project.
  3. Learn Syntax: Study Microsoft’s AL documentation or read MVP’s blogs (wink:)
  4. Test Locally: Use a sandbox environment in Business Central to test extensions before deployment, or a Docker container.

AL development empowers developers to customize Dynamics 365 Business Central efficiently, offering a modern alternative to C/AL and a focused approach compared to general-purpose languages like C# or JavaScript. With its event-driven model, extension framework, and robust tooling, AL is the only choice for Business Central customization. Start exploring AL development today to unlock tailored solutions for your business!

Share This Post

Related Articles

2 Responses

  1. I like the idea of the post but is this AI written?

    Some Reasons:

    – “AL development shines for businesses using Dynamics 365 Business Central.”
    It only EXISTS there!

    – “Its event-driven model, extension-based architecture, and tight integration with VS Code make it ideal for creating scalable, upgrade-safe customizations.”
    True, but sounds strange.

    – Conclusion
    Also full of “best for” etc…AL is the only way to develop business logic in BC. There is no (real) alternative.

    1. Thank you for your detailed and honest feedback!
      You’re absolutely right that AL is indeed the only way to develop business logic for Dynamics 365 Business Central, and its existence is deeply bound to that ecosystem. I touched on the original article to emphasize this point. My intention in describing how AL “shines” was to highlight its strengths within its unique context, but you make a good point—it doesn’t really have a direct competitor or alternative for BC customization. Yes, we can inject some javascript in the app via control add-ins but AL is the base.
      About marketing style notes:
      It’s true, AI tools did help analyze and structure the information (including Grok and editorial AI support). This sometimes results in more generalized or “marketing style” phrasings, such as “best for” or “shines,” which can sound odd in the context of technology blogs.
      I do my best to inject hands-on insights, but I appreciate your call for more technical nuance and specificity.
      Appreciate your feedback!
      I’ll look to make future pieces on AL (and other technical subjects) more direct about the unique placement and realities of the language, and will add a note in the blog where AI assisted with the content.
      If you have specific aspects of AL in BC or scenarios you’d like to see covered with more technical depth, let me know! I’m always looking to improve my coverage and make it more useful to the community.

Leave a Reply

Recent Posts

Get Notified About New Posts

Categories

Discover more from Business Central Musings

Subscribe now to keep reading and get access to the full archive.

Continue reading