Enable D365 experience in Dynamics NAV ‘Tenerife’ Developer Preview

23 May

It shouldn’t require any introduction by now, a new developer experience is on its way for Dynamics NAV developers. If you had not a chance to play with it, you should really go and give it a try. Read more about it on the NAV Team blog and on various blogs around.

This new developer experience is first and foremost targeted at developing extenstion for Dynamics 365. Like Microsoft announced, Dynamics 365 for Financials will have the same code base as Dynamics NAV. However, the user experience is different. Dynamics 365 for Financials can be set to different experiences using the application area functionality. Which application areas are enabled is visible in the Application Area page.

However, unlike Dynamics NAV 2017, this page is not editable in Dynamics 365. And it is not editable in the Dynamics NAV ‘Tenerife’ Developer Preview image on Azure either. Page 9179 Application Area is uneditable in many ways. I mean, the property Editable is set to false, the properties InsertAllowed, ModifyAllowed and DeleteAllowed are set to No. And on top of that, the SourceTable is set to Temporary. Someone must be scared that you can change a setting here…

But wait a minute… that Dynamics NAV ‘Tenerife’ Developer Preview was released so we can experience how to create extensions for Dynamics 365. And now we cannot change the application to behave like Dynamics 365? If I create an extension, I would like to see how it looks like in a real Dynamics 365 experience.

First reaction could be to modify the Application Area page and set it to editable again. That’s possible, since the code behind still supports saving the settings to the database. There is another way, though.

The Dynamics 365 experience setting has moved to the Company Information page. Open that page in the designer and look all the way down. There you will find two groups, called User Experience. However, these groups are only displayed when the software detects that it is running as Software as a Service. This code is used on multiple places and this is what makes up the different experiences between Dynamics 365 for Financials and Dynamics NAV.

All right, secret revealed. If this function returns true, we will have full Dynamics 365 for Financials experience.

How this the function looks like? Let’s take a look at Codeunit 9002 Permission Manager:

The table Membership Entitlement is a system table. It is empty on the Azure VM, and I have no idea what should be in. Of course we can just change this function and let it always return TRUE. But we are decent extension developers, right? So we look for a solution to change this behavior without touching it.

That boolean TestabilitySoftwareAsAService is something we can work with. It’s a global variable wich can be set by using the function SetTestabilitySoftwareAsAService.

And because Codeunit 9002 is a single instance Codeunit, we only have to set this once when we log in. Aha, now we are talking, we can do that with an event subscriber to the OnBeforeCompanyOpen event! And because the function is marked as External, we can call it directly from an Extensions created with VS Code. Bingo, we can now create an extensions to enable Dynamics 365 experience.

So that’s what I did. I have crated an extensions with AL code in VS Code that can be used to switch Dynamics 365 mode on and off with a button on the Company Information page. And when it’s on, you get the Basic experience, including the Notifications that only popup on Dynamics 365 for Financials. With the setting on Company Information you can switch this to Suite mode. Just remember to log off and on again to get the new Experience.

The code of the Extension is available on the GitHub repository of Cloud Ready Software: https://github.com/CloudReadySoftware/AL_Samples

Want to learn more about Extensions v2, AL language and VS Code? Contact me for training opportunities!

2 thoughts on “Enable D365 experience in Dynamics NAV ‘Tenerife’ Developer Preview

  1. Pingback: Enable D365 experience in Dynamics NAV ‘Tenerife’ Developer Preview - Kauffmann @ Dynamics NAV - Dynamics NAV Users - DUG

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.