Modifying Dynamics 365 Sales Code for Technical Upgrade to Dynamics NAV 2018

Applies to: Microsoft Dynamics NAV 2018 cumulative update 41 and later.

If your solution integrates with Microsoft Dynamics 365 for Sales, and you're upgrading to Dynamics NAV cumulative update 41 (Build 47056) or later, you'll have modify some code before you do the upgrade.


Dynamics NAV cumulative update 41 introduced the following changes will affect the integration:

  • Support for CRM version 8.x has been removed and replaced with CRM SDK version 9.1. The CRM SDK version 9.1 is now part of Dynamics NAV Integration Solution (.zip) found on the installation media (DVD).

  • Newtonsoft.Json.dll version is used in the binaries, instead of version 9.0.1

  • Microsoft.IdentityModel.Clients.ActiveDirectory version 3.19 is required instead of version 2.28.

The following sections explain how to address these changes.

Make variable declarations version-agnostic

In C/AL code, you'll have to change the version-specific references to CRM version 8 and Newtonsoft.json.dll version 9 to be version-agnostic. This section describes the changes that you have to make. The following base application objects objects have been identified as containing such explicit version-specific references, which you'll need to change as a minimum. Your application might contain more.

  • Codeunit 1355
  • Codeunit 2801
  • Codeunit 5330
  • Codeunit 5459
  • Codeunit 5468
  • Codeunit 7820
  • Page 2823
  • Table 5330

Variable declaration changes

  • Change:

    DotNet "'Newtonsoft.Json, Version=, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.<class/type>” 


    DotNet "'Newtonsoft.Json'.<class/type> 
  • Change:

    DotNet "'Microsoft.Xrm.Sdk, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.<class/type>"  


    DotNet "'Microsoft.Xrm.Sdk'.<class/type>” 
  • Change:

    DotNet 'Microsoft.Xrm.Tooling.Connector, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.<class/type>” 


    DotNet "'Microsoft.Xrm.Tooling.Connector'.<class/type>” 

Update Microsoft.IdentityModel.Clients.ActiveDirectory (post-upgrade)

Microsoft.IdentityModel.Clients.ActiveDirectory version 3.19 is provided on the installation media (DVD). It should be installed automatically when you install Dynamic NAV Server. But after upgrade, it's a good idea to verify that you have the correct version in the Dynamics NAV Server installation folder. By default, the folder is C:\Program Files\Microsoft Dynamics NAV\110\Service.

To check the version, search the folder for "Microsoft.IdentityModel.Clients.ActiveDirectory.dll". Open its Properties, and look at the File Version on the Details tab. If the version is not 3.19, copy the Microsoft.IdentityModel.Clients.ActiveDirectory.dll file from the ServiceTier\program files\Microsoft Dynamics NAV\110\Service folder of the installation media (DVD) to your Dynamics NAV Serve installation folder.