How To Replace Deprecated Client API With New API

In the blog, we will see how easy is to convert existing code with  Xrm . Page to use the new form Context object.

There are significant changes made to client-side APIs in Dynamics 365 V9.X releases. Below are some of the main changes you will find in the latest version:

Execution Context It defines as event context in which code executes. Using execution context, we can retrieve form or grid context instead of Xrm.Page which is deprecated in the next release.
Global Context A new API added to the Xrm.Utility object to retrieve information specific to Organization, user and client. It is equivalent to Xrm.Page.context object (i.e; deprecated ).       
New Client APIs Number of new APIs are, Xrm.Device, Xrm.Encoding, Xrm.Navigation, Xrm.WebApi
Some Deprecated APIs are Xrm.Page, Xrm.Page.Context, Xrm.Mobile.offline, parent.Xrm

 

Execution Context: From the above definition we understand what execution context is, now we see how we pass to our new codes. We can pass this in two ways:

  1. Pass through UI: Execution context is an optional parameter that can be pass to JavaScript library function through an event handler, by selecting Pass execution context as the first parameter in event handler properties dialog.
  2. Pass through code:Execution context is automatically passed as the first parameter to the function.
Nikhil Gahlot

linkedin Nikhil Gahlot, Soluzione's visionary Chief Technology Officer, brings over 22 years of expertise in tech innovation, product development, and CRM transformations. With a stellar background at Mahindra Satyam and Microsoft, he leads Soluzione, propelling the organization to reshape lending through advanced cloud, AI, and ML technologies. Nikhil is a trailblazer in pre-sales, solution development, and entrepreneurship, and his leadership fuels innovation and revolutionizes the digital era.

All author posts
Write a comment
WhatsApp Chat