How to connect Visual Studio code with Dynamics 365 Business Central On-premise
Published on July 21, 2021
To set-up Visual studio code with Dynamics 365 Business Central, our Business Central experts have devised a step-by-step process explaining how to link Visual Studio code with Business Central. The steps are as follows:
Step 1: Install the visual studio code and extensions
The following VS code extensions are to be identified, installed and enabled in your visual studio code
- AL language- AL development tools for Dynamics 365 Business central
- AL language Tools- Tools for a better BC development experience (Dynamics 365 Business Central)
- AL object designer- Object designer optimized for (Dynamics 365 Business Central) AL language development
- AL snippets-gives you a template for the specific object type
- AL Toolbox- adds the region functionality to the Microsoft AL language for Business central
- AL Extension pack- Everything you need for AL development (Microsoft Dynamics 365 Business Central)
- AL Formatter- Formatting AL code, fixes indenting, casing and variable sorting
- AL variable helper- Intellisense to assign correct variable names in AL
- AL Studio-Visual editor/navigation tools for AL development
Step 2: Use shortcut key CTRL + SHIFT + P to open the command pallet. Search for the command AL: Go to open a new project

Step 3: Assign a name to your project. Each project will have app.json created which contains the version and page id of the project

Step 4: Select server as Your own server. This will create launch.json which has the server details

Step 5: Mention the server, server instance and port number of your server in launch.json
Note: The server, server instance and development port number of the server can be viewed in the business central administration tool.

Step 6: Enable the developer service endpoint in the administration tool

Step 7: After enabling the developer service endpoint restart your service
Step 8: After making the above changes, open the previously created project in VS code. The error will be viewed in the sample helloworld program. Use shortcut key CTRL + SHIFT + P to open the command pallet and search for the command AL: Download symbols

Step 9: On running the above command, the objects and extensions of Dynamics 365 Business central will downloaded

Step 10: Open Dynamics Business central administration and select your server instance (Ex: BC170_PROD) and click edit

Step 11: Set your Web Client Base URL (Ex: http://localhost:8080/BC170_PROD/) in client service

Step 12: To publish the project, use shortcut key F5 in VS code. Once published, the following output will be viewed in Business central
