The Extensions are a programming model where functionality is described as an addition to the present objects and describes how they are different or modify the behavior of the solution. This article explains how you can develop extensions using the Dynamics 365 Business Central AL Development Environment.
If you are new to building extensions, we recommend that you read this document to get an understanding of the basics and terms you will encounter while working.
Dynamics 365 Business Central AL Development Process
1. Understanding Objects in the Development Environment
All functionality in Dynamics 365 Business Central is coded in objects. The extension is object based, you generate new objects and expand the existing objects based on what you want your extension to do.
The Table objects describe the table schema that contains the data, the page objects represent the pages that are shown in the user interface and code units contain code for logical calculations and for the application behavior.
These objects are stored as code, known as AL code and are stored in files with the
.al file extension. The AL Language extension also assists the multi root functionality which permits you to work with many AL folders within one workspace.
There are two other special objects which are specifically used for building extensions. Table extension objects and page extension objects are utilized for defining additive or overriding changes to table or page objects.
For example, an extension for administering a business that sells organic food may define a table extension object for the Item table that contains two additional fields,
Produced Locally fields are not present usually in the Item table, but through the table extension these data fields will now be available to store the data in and to access from code. You can then use the page extension object to display the fields that you added to the table object.
2. Developing Extensions in Visual Studio Code
Using the AL Language extension for Visual Studio Code, you will get the benefits of a modern development environment along with seamless publishing and execution integration with your Dynamics 365 Business Central tenant. Visual Studio Code and the AL Language extension allows you to do the following tasks:
- Create new files for your solution
- Get assistance with creating the appropriate configuration and setting files
- Use code snippets that provide templates for coding application objects
- Get compiler validation while coding
- Press Ctrl+F5 to publish your changes and see your code running
The Designer works in the client itself allowing design of pages using a drag and drop interface. The Designer allows building extensions in the client itself by rearranging fields, adding fields, and previewing the page design.
4. Compiling and Deploying
Extensions are compiled as .app package files. The .app package file can be deployed to the MS Dynamics 365 Business Central server. An .app package contains the various artifacts that deliver the new functionality to the Microsoft Dynamics 365 Business Central deployment as well as a manifest that specifies the name, publisher, version and other attributes of the extension.
5. Submitting your App
When all development and testing is done, you can submit your extension package to AppSource. Before you submit the extension package, we encourage you to read the checklist to help facilitating the validation. For more information on Microsoft Dynamics 365 Business Central AL Development, please contact us.