Generate Symbols in a Modern Development environment with Microsoft Dynamics NAV 2018


With the general availability of Microsoft Dynamics NAV 2018 in the first week of December 2017, the new and Modern development environment experience becomes more and more used by developers; side by side with the C/SIDE development environment.

Working with a standard CRONUS database is pretty easy, while every developer would like to give it a spin with their own customized database. In this scenario, it is paramount to have the appropriate symbols generated in order to be successfully pulled out by AL Extension command in Visual Studio Code and develop a custom extension against a proper customized source database.

Installing CSIDE Development Environment side by side with Modern Development Environment is duly described in the docs, as well as how to generate / re-generate symbols. For more information, see https://docs.microsoft.com/en-us/dynamics-nav/developer/devenv-running-cside-and-al-side-by-side.

Here are a few tips that can be helpful when generating symbols.


1. The finsql.exe command must be executed client side.

Run a command prompt and change directory to the client folder (typically C:\Program Files (x86)\Microsoft Dynamics NAV\110\RoleTailored Client).

From the client directory run the following command

finsql.exe Command=generatesymbolreference, Database="Demo Database NAV (11-0)", ServerName=ITMBSNAV

where Database is the database where you wish to generate symbols and ServerName is the SQL Server instance where the Database is attached

NOTE: The command itself might give the idea to be completed in few milliseconds but this is not true since finsql.exe continue to run in background even if the prompt returns to the command console window.


2. Use Task Manager to inspect the resource consumption by finsql.exe process.

When running finsql.exe with the generatesymbolreference parameter key within command prompt, it might seem the process ending too fast or that nothing happened.

Just close the command prompt and run Task Manager (taskmgr.exe) and go to tab Details to inspect finsql.exe background process and its resource consumption.
You might notice memory growing up high of several hundreds of MB and process disappear when finished.


3. Check for navcommandresult.txt file in the client folder.

When the process ends, a file is always generated in the RTC client directory named navcommandresult.txt. If all goes ok you might find something like the following
[0] [06/12/17 14:36:17] The command completed successfully in '177' seconds.
If the finsql.exe command fails or generates error for whatever reason, you might find an additional file called naverrorlog.txt with the error log description.

That’s it. When symbols are generated correctly, these are ready to be fetched by AL Extension from Visual Studio Code.

Further simple tips that might apply when working with the Modern Development Environment


4. Make sure you use the right AL Extension.

The Dynamics NAV 2018  installer (setup.exe) includes an option to install the Modern Development Environment. If you choose that option, you will find a Modern Development Environment directory together with the client folder. Inside there is the appropriate VSIX file to work with that specific Dynamics NAV version.

Make sure you use that one with Microsoft Dynamics NAV 2018. To import the VSIX file, simply run Visual Studio Code and choose the Extension tab (CTRL+SHIFT+X) then click on “More” (the three dots, top right) and select “Install from VSIX…” option.

NOTE: It is very important to have the VSIX from the same platform version as your Dynamics NAV installation, otherwise you cannot publish (F5) your extension. Be really sure, then, to have the same VSIX targeting your Dynamics NAV 2018 installation files (e.g. VSIX RTM targeting RTM installation, VSIX CU 1 targeting CU 1 installation and so on).


5. Populate Web Client Base URL in the Client Service tab in the NAV Administration Console.

This is needed when you publish your APP with or without debugging or an error like the following might be thrown in Visual Studio Code

[2017-12-07 22:32:23.32] Error: Could not open the specified startup page. Please check that the server configuration key PublicWebBaseUrl has been properly set


6. Disable CAS Policy to enable Visual Studio Code AL Debugger

It is mandatory to disable CAS policy server side when publishing the APP from Visual Studio Code with AL Debugger enabled (F5). If this is not enabled, you will receive an error when NAV Web Client is about to be loaded.


To disable CAS policy, locate Microsoft.Dynamics.NAV.Server.exe.config file in the server directory and change the relevant entry in the following way:

<netfx40_legacysecuritypolicy enabled="false"/>

Restart the Dynamics NAV Server service to make the modification effective.

 

These postings are provided "AS IS" with no warranties and confer no rights. You assume all risk for your use.

Duilio Tacconi (dtacconi)

Microsoft Dynamics Italy
Microsoft Customer Service and Support (CSS) EMEA

Comments (12)

  1. Very nice write-up, as always good content by Duilio. Thanks!

  2. Very informative one, grazie!

  3. XAVIER GARONNAT says:

    Excellent !

  4. Excellent post Duilio 😉

  5. Mantas Duda says:

    Atleast theare you can find the right Information. Microsoft Dokumentation sometimes is crap.
    Many Thanks Duilio.

  6. Thanks for the nice description – i had an issue that i had to select an instance because i had two instances running on the same database. Solved it by closing one of them…

    1. One more comment – after being able to successfully use the command generatesymbolreference (i am on nav 2018 CU 4) I was not able to download symbols. After numerous attempts no luck. the package was neither visible from the command Get-NavAppInfo – Servierinstance xxx -SymbolsOnly…

      I solved it by creating a new project with AL go (Hello World), where the files Microsoft_Application_11.0.21441.0.app and Microsoft_System_11.0.12925.0.app was created. here i used the _system file and published it to the database with Publish-NAVApp pointing out the file from its destination. After that i had to create new AL files for the modifications using the commands:
      1. export:
      finsql.exe Command=ExportToNewSyntax, File=”D:\ALextensions\CAL\export.txt”, Database=”NAV2018Test2”, ServerName=.\NAV, Filter=Type=table;ID=50000..51603

      2 convert:
      txt2al –source=”D:\ALextensions\CAL” –target=”D:\ALextensions\AL” –rename

      I copied the converted objects into a new AL project and “compiled” them with CTRL F5 in order to get the file:Microsoft_System_11.0.12925.0.app from the project.

      Then i again used the command Publish-NavApp from the Dynamics NAV Administration Shell where i pointed to this file. And finally i was able to see the new tables in the symbol menu and build new pages for them etc.

      A long road to AL land and I am not sure why it had to be so….?

    2. Hi Michael,
      Having the exact same issue and don’t understand why it has to be so difficult….. I was trying to follow your example, manually publish system to the server. But getting: Your program license does not allow you to publish ‘Access Control’.

      1. Anonymous says:
        (The content was deleted per user request)
      2. Hi Erik,

        I am not sure why – the windows user i was using had dbo rights on database – i had developers license saved in the database. and ran powershell as administrator. the instance was running on same user as my user logged in…

        1. I also run it as administrator, but this is not a permission, but a license issue, if the error message is correct.

          1. Problem solved. I didn’t specify PackageType = SymbolsOnly, when publishing the system.app etc., as this option was not available via navcontainerhelper.

Skip to main content