The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.
Development in AL
Extensions are a programming model where functionality is defined as an addition to existing objects and defines how they are different or modify the behavior of the solution. This section explains how you can develop extensions using the development environment for Dynamics 365 for Finance and Operations, Business edition and Dynamics NAV. For an overview of developing apps for Dynamics 365 for Finance and Operations, Business edition and Dynamics NAV, see aka.ms/GetStartedWithApps.
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. Next, follow the Getting Started with AL to set up the tools.
AL tools functionality is supported in Dynamics 365 for Finance and Operations, Business edition and Dynamics NAV, but in some cases, there are limitations. These limitations are marked clearly in the specific topic.
Understanding objects in the development environment
All functionality in Dynamics 365 for Finance and Operations, Business edition and Dynamics NAV is coded in objects. The extension model is object-based; you create new objects, and extend existing objects depending on what you want your extension to do. Table objects define the table schema that holds data, page objects represent the pages seen in the user interface and codeunits contain code for logical calculations and for the application behavior. These objects are stored as code, known as AL code, and are saved in files with the
.al file extension. The AL Language extension also supports the multi-root functionality which allows you to work with multiple AL folders within one workspace.
For more information on how to group a set of disparate project folders into one workspace, see Working with multiple AL project folders within one workspace.
A single .al file may contain multiple objects.
There are two other special objects which are specifically used for building extensions. Table extension objects and page extension objects are used for defining additive or overriding changes to table or page objects. For example, an extension for managing a business that sells organic food may define a table extension object for the Item table that contains two additional fields,
Produced Locally. The
Produced Locally fields are not usually present in the Item table, but through the table extension these data fields will now be available to store 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.
Extension objects can have a name with a maximum length of 30 characters.
You have several options for creating new objects with the AL Language extension for Visual Studio Code. For more information about the objects that you can create for your extension, see AL Development Environment.
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 for Finance and Operations, Business edition tenant. For more information on getting up and running, see Getting Started with AL.
Visual Studio Code and the AL Language extension lets you 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 F5 to publish your changes and see your code running
For more information, see Visual Studio Code Docs.
If you have previous experience working with the C/SIDE development environment and need an overview of some of the changes between the two development environments, see Differences in the Development Environments.
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. For more information, see Using Designer.
Compiling and deploying
Extensions are compiled as .app package files. The .app package file can be deployed to the Dynamics 365 for Finance and Operations, Business edition server. An .app package contains the various artifacts that deliver the new functionality to the Dynamics 365 for Finance and Operations, Business edition deployment as well as a manifest that specifies the name, publisher, version, and other attributes of the extension. For information about the manifest, see JSON Files.
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, see Checklist for Submitting Your App.