This article provides an overview of the different extension objects that you can write to extend base application functionality in Business Central. You can use extension objects to extend tables, pages, reports, and enums. For example, by using an extension object, you can add new fields, actions, and layout to an existing page, or add data items, columns, request-page controls, and layouts to an existing report. By using an enum extension, you can add new values to an existing enumeration.
Tables, pages, and reports are extensible by default. Enums aren't extensible by default; set Extensible = true; on an enum that other extensions can extend. Permission sets are inherently extensible.
The following table lists the different extension objects that you can create in AL.
| Object type | Description |
|---|---|
| Table extension | Add fields to an existing table. |
| Page extension | Add fields, actions, and layout to an existing page. |
| Report extension | Add data items, columns, request-page controls, and layouts to an existing report. |
| Enum extension | Add new values to an existing enumeration. |
| Permission set extension | Add new permissions to an existing permission set. |
| Profile extension | Extend an existing profile, available from runtime 14.0. |
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.
From runtime 13.0, supported extension objects can coexist with their targets in the same app. For example, an app can contain a table and its table extension, a page and multiple page extensions, or an enum and its enum extensions. 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.
Related information
Extensibility overview
Table extension
Page extension
Report extension
Enum extension
Permission set extension