It is clear that the future of NAV is Visual Studio Code and AL. And to be honest I find more fun and interesting to play with this “smart text editor” compared to the old “development UI” C/Side. Even if at the beginning it seems more difficult because you need to know in what places to add certain pieces of code related to the object’s structure while in C/Side you are helped by the UI.
Let’s see which are the steps you need to do in order to start writing AL extensions in Visual Studio Code and publish them to a local NAV 2018 server instance:
3) Change NetFx40_LegacySecurityPolicy setting in Microsoft.Dynamics.Nav.Server.exe.config file to false and restart NAV Server. Please see the following link:
In case you don’t change this setting you will get an error when you try to publish the extension and open the web client in debugging mode.
By default the Development port is setup as 7049 at the NAV Server level. If you change this value, you will have to add also the new port number in the “launch.json” file as new key-value pair.
7) Download Symbols: CTRL + SHIFT + P and command AL: Download Symbols. If the symbols are successfully downloaded you will see this:
By doing this a new folder will be created in your project’s main folder: “.alpackages”. The symbols are references to the base application objects and system objects. This is how VS Code will know, for example, if you extend table 37 “Sales Line” by adding a new field what “table 37” means.
Because in this example we are using Windows authentication it does not ask for credentials. If you are using UserPassword option you will also need to enter credentials.
9) If in your “launch.json” file the startupObjectId is 22 (Customer List), this page should open in NAV Web Client and because we extended it’s “OnOpenPage” trigger with a message you receive message:
10) Open page “Extension Management”. Here you can see that the extension was Published and Installed to the NAV Server when you used Command “Publish” in Visual Studio Code. Published means that the extension was “added” to the server and Installed means it was also “activated”.
You are now ready to develop in the new Nav 2018 Modern Development Environment using your local Nav Server Instance.