Category Archives: Modern Dev

C/AL Open Library Works – I have proof

When Microsoft announced that DotNET support was being discontinued in the modern development environment, many of us had issues with it. I still believe that it was a too drastic approach, but that’s not a focus of this blog post.

A bit later, Microsoft announced the “CAL-OPEN-LIBRARY” – A GitHub repository for wrapping dotnet classes in codeunits.

It can be found here The basic idea, is that you can write a codeunit that wraps a DotNet class and submit that to Microsoft for consideration for future products, so I did πŸ™‚

One of the DotNet classes I use all the time, is the MemoryStream, a stream you can both write to and read from, and that holds the data in memory (hence the name).

I wrote a codeunit with the functions I needed, with tests and submitted that as a pull request.

And when NAV2018 came out, codeunit 704 has appeared:

There is my wrapper, all ready to go.

Lots of other people, incl. several MVPs, have also added contributions to the cal-open-library, go check it out. And the next time you’re missing something, contribute, it works πŸ™‚

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 πŸ™‚