Tuesday, October 2, 2018

MSDYN365BC - Connect Microsoft Dynamics 365 BC On-Prem To Visual Code Editor?

Hi Readers,


If you are reading then you know that we have already installed Microsoft Dynamics 365 BC (on-prem) and also checked where components are installed and all available client options.

In this article, we will discuss how to connect your local MSDYN365BC (on-prem) environment to the VS Code that we will use to customize nav using Future Programming Language (AL).

This article is based on the request from Angelo Castro, so all thanks to him.

Click here to access all published Article about MSDYN365BC.

1. Open VS Code.



2. Use KeyBoard Shortcut Ctrl+G to open Command Palette (as shown below) as type - >AL:Go! or used shortcut Alt+A and Alt+L.



3. By Default System will try to add a folder in Your Document Folder for an extension. You can change the folder name or the path if you want (as shown below).



4. The system will create a folder in the specified path. Then please select the Server, this will be the next option in the same window. (Select your own Server)


5. If you are using Navuserpassword authentication then enter Username and Password, otherwise hit enter as shown below. The system will create the launch.json as shown below. We will update the configuration file to map to the local database.


6. Update authentication Parameter to Windows (if you are using windows authentication).
    Update Parameter ServerInstance with the service name as shown below.


7. By default system maps the Port to 7049, but if you are using a custom port then you need to update that port number manually in the configuration file as shown below.


8. To verify that VS Code is ready to code against the Service Tier (it is mapped to), default HelloWorld.al should get compile as shown below. As of now if you can see, HelloWorld.al is not compiled and have some problems reported in the screen below.


9. To get it Problem resolved, we need to download symbol from the database mapped to service.
Let's use shortcut again Ctrl + G and select > AL:Download Symbols as shown below. This action will download references to all NAV Objects in the database mapped to service and we will see a confirmation in the bottom part of the screen as shown below.


10. Once symbols are downloaded, the Hello World. al file should get compiled without any problems reported. (as shown below)



All good. We can delete the HelloWorld.al and start preparing our extension for Business Central on- Prem.

Hope you find the information useful. Let me know if any questions.

Stay tuned for more.

Regards,
Saurav Dhyani
https://saurav-nav.blogspot.com