Import Symbols in New or Upgrade Databases with Microsoft Dynamics NAV 2018

What does upgrading databases have in common with creating new databases in Microsoft Dynamics NAV 2018? They do not contain symbols. More precisely, when upgrading a database from an older version to Dynamics NAV 2018, or creating a new database for the same version, it does not have any symbols automatically created or imported.

If you intend to develop your extension with Visual Studio Code, it is mandatory that you accomplish this task and set a couple of new rules when upgrading or creating new databases:

#1 Which Symbols do I need?

You can determine this easily by deploying a Cronus database from Microsoft Dynamics NAV 2018, run an elevated PowerShell ISE, and type the following:

Import-Module 'C:\Program Files\Microsoft Dynamics NAV\110\Service\NavAdminTool.ps1'
Get-NAVAppInfo -ServerInstance DynamicsNAV110 -SymbolsOnly

This will result in the resume of Symbols App needed for Modern Development. See below the result:

Id : e917aee5-0860-45c4-98e3-354769cabecf
Name : Application
Version : 11.0.19846.0
Publisher : Microsoft
ExtensionType : ModernDev

Id : d4a14f4a-0ae8-4501-a527-b3e36c0c3d67
Name : Test
Version : 11.0.19846.0
Publisher : Microsoft
ExtensionType : ModernDev

Id : 8874ed3a-0643-4247-9ced-7a7002f7135d
Name : System
Version : 11.0.12925.0
Publisher : Microsoft
ExtensionType : ModernDev

There are three standard symbol apps that are needed to make the database suitable for Extension V.2 development On-Premise:

– APPLICATION
Contains symbols for all the application objects described in the object designer, except system tables spanning from 2000000004 to 2000000199 and standard Test Toolkit objects.
This is only needed if you deploy a standard Cronus database and it is intended to be a starting point for developers. Usually, developers should opt for generating symbols through C/SIDE as described in our earlier blog post: Generate Symbols in a Modern Development environment with Microsoft Dynamics NAV 2018

-SYSTEM
Contains symbols for system tables spanning from 2000000004 to 2000000199.
System table symbols are not regenerated. For this reason, in a Modern Development environment, they should not be considered for any changes within C/SIDE.

-TEST
Contains symbols for Application Test Toolkit objects.
Standard Application Test Toolkit object symbols are not regenerated. For this reason, in a Modern Development environment, they should not be considered for any changes within C/SIDE.

#2 Where and how do I get these Symbols?

There are several ways to obtain the appropriate symbols for upgraded or new databases. The official upgrade documentation references where you can find the symbols file. Just check “Task 19: Publish and install/upgrade extensions” in Upgrading the Data to Microsoft Dynamics NAV 2018 on Docs.

Usually, Symbol apps could/should be downloaded from the ModernDev folder in the product DVD and published in the database through PowerShell with the following syntax:

Import-Module 'C:\Program Files\Microsoft Dynamics NAV\110\Service\NavAdminTool.ps1'
Publish-NAVApp -ServerInstance DynamicsNAV110 -PackageType SymbolsOnly -Path C:\Temp\Microsoft_System_11.0.12925.0.app -SkipVerification
Publish-NAVApp -ServerInstance DynamicsNAV110 -PackageType SymbolsOnly -Path C:\Temp\Microsoft_Test_11.0.19846.0.app -SkipVerification

NOTE:
Symbols app files must be taken from the DVD that your installation is targeting to match fully the System and Test application definition. Therefore, version number (e.g., 11.0.12925 or 11.0.19846) could be different from the one shown in the example above.

Application Symbol app file is not included in the installation DVD since most likely the On-Premise application is customized and the equivalent symbols need to be generated through finsql.exe.

NOTE:
When working side by side with C/SIDE Development Environment and Visual Studio Code, it is recommended to start finsql.exe with generatesymbolreference flag active as described in the earlier blog post: Generate Symbols in a Modern Development environment with Microsoft Dynamics NAV 2018

With the flag active at runtime, any compilation would generate, update or delete the symbol references. In Visual Studio Code, you could easily get these changes when downloading symbols. Moreover, there are two other advantages:

  • When compiling few objects, the compilation overhead that generates symbols might be negligible and not even perceived.
  •  NAV Server has cached in place to recognize what has changed and optimized for faster symbol adjustments.

There is an alternative way, a Modern Developer trick, to gather standard Symbol app files easily: extract them from a standard Cronus database. By creating a simple “HelloWorld” sample through AL: Go!, it is possible to download Application and System app symbol files automatically from a CRONUS database. This is the default behavior. But what about the Test Symbol app file? To have this extracted too, the trick is to add it as a dependency in the App.json file in the following way:

"dependencies": [
{
"appId": "d4a14f4a-0ae8-4501-a527-b3e36c0c3d67",
"name": "Test",
"publisher": "Microsoft",
"version": "11.0.19846.0"
}
]

where appId, name, publisher and version can be determined dynamically using Get-NAVAppInfo PowerShell cmdlet. In the end, the “HelloWorld” sample could be simply discarded, and the developer only retains distilled Symbol app files contained in the .alpackages folder for a future usage/import in upgraded or new databases.

These postings are provided “AS IS” with no warranties and confer no rights. You assume the entire risk when you use it.

 

Duilio Tacconi (dtacconi)
Microsoft Dynamics Italy
Microsoft Customer Service and Support (CSS) EMEA

Thanks to Stanislaw Stempin and Kalman Beres (Modern Dev team MDCC Lyngby)