How to reference another extension from an extension

With NAV2018 you can have multiple extensions installed, and it is possible to make a dependency reference from one extension to another, but how? When downloading symbols, you’re only getting system and application.

First, go to extension management and locate the extension:

In this case, I want to reference the Image Analyzer extension.

Please be aware, that several of the extensions installed in NAV2018 are still V1 extensions, and you can reference and download “symbols”, but the symbol file is empty. So currently it’s not possible to reference a v1 extension from a v2.

Use the “About This Page” function to get to the fields behind the extension:

We are interested in the ID, Name, Publisher and Version.

Create a new object {} in the dependencies section of app.json and add the four lines:

Here I have added dependencies to the Image Analyzer and the PayPal extensions (The PayPal being a v1 and does not work).

Using AL:Download Symbols will give me four symbols files (the two dependencies plus System andΒ Application.

So now I can reference the objects in that extension from my own:

Discovery is still kind of bad; you’ll still need to guess what’s in the extension (unless you open the .app file (hint, it’s just a ZIP) and poke around πŸ™‚

New Database Layout in NAV2018 when using Extensions

With Extensions v2 in Microsoft Dynamics NAV2018, fields are distributed across multiple SQL tables. In the example here, I have added a tableextension object that adds the “KOB Nummer” field to the customer table.

As you can see, there is a new table in the SQL, “Customer@2039b279……..” (same guid as my extension)

So in order to get to your complete/combined customer table from SQL, you must JOIN the two tables.

Here is a trick, if you RUN the table from C/Side, you’ll see the fields added by extensions, even though you cannot see the extension fields in C/Side.

How to enable ModernDev on NAV2018

Go into the Dynamics NAV 2018 Administration, select the Development fast tab, check Enable Developer Service Endpoint.

Now port 7049 is open, and you have access to use Visual Studio Code.

You should also specify the target of your extensions:

So far chose internal … more on this later….

To get Visual Studio Code up and running, you need the VS extension; it can be found here in the install image:

\ModernDev\program files\Microsoft Dynamics NAV\110\Modern Development Environment\ALLanguage.vsix

In Visual Studio Code, use Install from VSIX from the extension … menu:

Install it, and you should get this:

Version 0.12.15355 is the version delivered with NAV2018.

I prefer my NAV installation running with NavUserPassword authentication, so I have changed the demo NAV2018 install into that. So the next step is to edit your launch.json file:

In my case, I have copied my self-signed certificate from Personal to Trusted Root to prevent certificate errors in VS Code:

Success:

The extension is now installed on my NAV2018 πŸ™‚