Work with JSON configuration files

Completed

JSON stands for JavaScript Object Notation, which is a lightweight data interchange format that is often used for storing and transporting data. An AL extension contains two JSON files: app.json and launch.json file. These files are automatically created when you start a new AL extension and are used to store configuration data.

Launch.json file

Launch.json is a configuration file that contains information about the server where the extension will be deployed to test and debug. Two configurations can be used, depending on whether the extension is published to a local server or to the cloud.

Screenshot showing the Launch.json Cloud Sandbox file.

The next table describes important and mandatory properties of the launch.json file. However, it's important to first learn about the startupObjectId and startupObjectType properties in this launch.json file.

Whenever you start your extension from within Visual Studio Code, it will look in this launch.json file to determine which object it needs to start with. The previous figure shows that it will start on page 22, which is the Customer List page. If you develop your own pages and want to start with them, replace the startupObjectId property with your own page number.

Here is a link where you can find more information about all settings in the Launch.json file: launch.json file.

App.json file

The app.json file contains information about the extension that you are building, such as publisher information, name, and the minimum supported version. Often the app.json file is referred to as the manifest.

Screenshot of a sample App.json file in Business Central.

Here is a link where you can find more information about all settings in the App.json file: app.json file.

App Identity

Apps built using AL extend the functionality of Business Central. The app.json file is, together with the launch.json file, automatically generated when you create a new AL project. The app.json file contains information about the app that you are building, such as publisher information and specifies the minimum version of base application objects that the extension is built on. Often the app.json file is referred to as the manifest. The app.json file contains numerous project settings, but a few of them constitute the actual identity of the app that you are creating.

With Business Central 2021 release wave 2, name and publisher are no longer considered part of the app identity and can therefore be changed to reflect branding or acquisition, for example. If the name and/or publisher information is changed, the version must also be incremented. If you are using workspaces with multiple projects and change the name or publisher of an extension in the workspace, the dependencies in the app.json file must be updated with the new name and publisher or you may encounter issues with reference resolution.

The ID of an app is automatically generated by the AL Language extension when you create a new app or if you use the AL: Generate manifest command.

If you have copied the app or the manifest from another app, you must change the ID before publishing it to the online service as a per-tenant extension or AppSource app.

After the app has been published, you should only change the ID if you intend to use the code base to develop a new app. You won't be able to upgrade from the app with the old ID to the app with the new ID because the system doesn't have knowledge about the correspondence.

If you have published your app as a per-tenant extension, but you are now considering publishing it to AppSource, you must assign a new ID to the AppSource app, as well as ensure that it follows all the technical requirements for publishing to AppSource.

It's recommended to use a different ID for the app that you publish from Visual Studio Code or to a container. Once you are satisfied with the quality of your app and are ready to publish it to AppSource, it's recommended to use a different ID. If you don't follow this approach, the app that you have published from Visual Studio Code to a developer sandbox will be automatically unpublished if another user tries to install the AppSource app.

If you are targeting only Business Central 2021 release wave 2 or later, the name of an app can be changed at any point also after it's been published. If the name is changed, the version must be incremented as well.

If you are targeting versions of Business Central prior to 2021 release wave 2, then the name of an app can't be changed after it has been published.

If you are targeting only Business Central 2021 release wave 2 or later, the publisher of an app can be changed at any point also after it's published. If the publisher is changed, the version must be incremented as well.

If you are targeting versions of Business Central prior to 2021 release wave 2, then the publisher of an app can't be changed after it has been published.

The version must be incremented anytime a new version of your app is uploaded to AppSource or as a per-tenant extension. While developing it in Visual Studio Code, you can keep using the same version and iterate on your code.