When upgrading from Dynamics 365 Online version 8.2 to version 9.0, it’s good practice to check for any deprecated components. One area with the biggest changes are the client APIs. Microsoft reorganized the Xrm Client API object model to support the new Unified Interface.

client apis

In almost all Dynamics 365 v8 or older instances there will be some custom JavaScript (OnLoad, OnSave, and OnChange events), iFrames, ribbon buttons, and HTML pages with will need to be evaluated. Dynamics 365 v8.2 can upgrade to v9 without replacing code using the deprecated client APIs with minor fixes as needed. The deprecated client APIs will continue to be available and supported until Microsoft officially removes them from a future major release of Dynamics 365.

Of course, code using those deprecated client APIs will need to be replaced eventually.

Let’s say your Dynamics 365 v8.2 has 100+ web resources files with 7,000+ client API functions that will need to be replaced. How do you go about changing 7,000+ client API functions? You can use Dynamics 365 v9 JavaScript Validator, Script Finder, and Ribbon Workbench
2016
from XrmToolBox, Team Foundation Server, Visual Studio, or even NotePad++.

You can use the Dynamics 365 v9 JavaScript Validator tool to connect to Dynamics 365 v8.2 and scan through all the customized JavaScript and HTML files and list all the deprecated JavaScript functions needing replacement. This tool will help give you an idea of the scope of the effort required.

Visual Studio can find and replace all the deprecated client APIs in JavaScript and HTML files. This process can take a while because you will want to review each client API logic and understand its function before replacing it with the new client API functions.

The next step would be to use the Script Finder tool to identify all the events called from OnLoad, OnSave, OnChange, ribbon commands, grid, etc. When you’re fixing these items, be sure to enable the checkbox to Pass execution context as the first parameter for new client APIs calls. In addition, the Script Finder tool can identify where the events trigger the test for the JavaScript.

For ribbon commands, add CRM Parameter equals PrimaryControl in the custom JavaScript action for the ribbon button to pass the form context using Ribbon Workbench 2016 tool. The PrimaryControl contains the form context object.

Lastly, you can create and organize plans to test form events and HTML web resources in Dynamics 365.

Replacing deprecated client APIs is just one component for the upgrade process to Dynamics 365 v9. If you’re looking to upgrade to Dynamics 365 v9, contact PowerObjects!

Happy Dynamics 365’ing!

Avatar for Joe D365

Joe D365

Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.