Edit

Extensibility overview

AL developers can extend the functionality of Business Central in several ways. They can extend tables, enumerations, application areas, pages, reports, code flows, and the security model. They can also request missing extensibility points or contribute application changes through the open-source BCApps repository.

This article provides an overview of the extensibility options available to AL developers in Business Central including examples on how to extend various features, such as extending item charges, best price calculations, and data archiving.

Extending AL objects and artifacts

The AL object model in Business Central supports many different ways for developers to extend objects and artifacts in an app.

Action Description Learn more
Extending Code Flows Codeunits contain AL code that you can reuse across the application. Developers can subscribe to events in base app codeunits and write custom logic to extend the application's functionality. Extending AL code flows: events
Extending Tables AL developers can add new fields to existing tables or modify the properties of existing fields. This capability allows customization of data structures to fit specific business needs. Extending AL objects: tables
Extending Pages Pages are the main way to display data in Business Central. Developers can add or modify fields, actions, and the layout of existing pages or create new ones. Extending AL objects: pages
Extending Reports Reports provide a structured view of data and are essential for analysis and decision-making. Developers can extend existing reports by adding data items or columns, modifying request pages, or adding new layouts. Extending AL objects: reports
Extending the Security Model Permission sets define what actions a user can perform in Business Central. Developers can create new permission sets or extend existing ones to ensure users have appropriate access rights. Extending AL objects: security model
Extending Enumerations Enumerations, or Enums, are lists of constants that represent a set of values. Developers can extend existing Enums or create new ones to cater to unique business requirements. Extending AL objects: enumerations
Extending Application Areas Application areas help control the visibility of UI elements based on licensing and configuration. Developers can extend these areas to tailor the user interface according to business needs. Extending AL objects: application areas

Note

Extending API pages and queries isn't currently possible in Business Central.

Extending the Business Central application

The Business Central application consists of multiple layers:

  • The System Application, which is a set of open-source modules that make it easier to build, maintain, and upgrade on-premises and online apps. These modules let you focus on the business logic and the needs of your users or customers.
  • The Base Application, which is the business logic for the functionality in Business Central.

Contributing to Business Central applications

The BCApps repository includes the Base Application, Business Foundation, System Application, Microsoft's first-party apps, and developer tools. If you want to contribute code, determine the type of contribution:

  1. Small bug fixes, product improvements, or customer conveniences; or
  2. New capabilities or larger changes to the existing application platform.

Before opening a pull request (PR), Microsoft must approve the related GitHub issue. Learn more in Contribute a change yourself and the BCApps contribution guidelines.

If you need a missing event, public procedure, or another extensibility point, create an extensibility request.

Learn more about the System Application, its module architecture, and how to modify or create new modules in Creating new modules in the system application.

Extending the Business Central base application

For more information on how to get started on extending functionality in the base application by extending AL objects and using events, see:

Extension objects in the same app

Note

This feature is available with runtime 13.0 and later and is enabled by default if you're targeting runtime 13.0 and later.

From runtime 13.0 and onwards, large applications have the ability to maintain a separation of concerns. This is achieved by permitting extension objects to coexist with their target within the same app. This facilitates the development of multiple extensions for a single target, all within the same app.

When table extensions live in the same app as their target, their fields and keys are integrated into the base table. This integration eliminates the need for SQL-joins during runtime.

All types of extension objects; enums, pages, reports, tables, and XMLports, can coexist with their target within the same app. This allows for various combinations, such as a single table with its table extension, a single page with multiple page extensions, multiple enum extensions, and so forth. This flexibility supports a wide range of application structures and functionalities.

Permitting extension objects to coexist with their target within the same app is useful for nondisruptive code refactoring within an app. It allows for dividing objects into modules based on specific functionalities, or for preparing to move objects into a separate app in anticipation of future releases.

With runtime 13.0, extension objects from a specific app are applied to the target based on the extension object ID. This introduces the following new compiler validations:

  • Base objects are prohibited from referencing members from extension objects.
  • An extension object can only reference members from other extension objects within the same app if the other extension object has a lower object ID.

Examples

Numerous examples demonstrate how to extend various features in Business Central:

  • Extending item charges
  • Extending best price calculations
  • Extending pages based on date virtual table
  • Data archive extension
  • Extending document sharing with OneDrive
  • Extending templates
  • Extending email

These resources provide a comprehensive overview of the extensibility options available to AL developers in Business Central.

Extending AL objects and artifacts

Extending the base application

Examples