Skip to main content

Notifications

Dynamics 365 Community / Blogs / Aric Levin's Blog / Migrating your Client API t...

Migrating your Client API to Dynamics 365 CE (v9) - Part I

In this series, I will show the list of Dynamics CRM Api calls, and their new counterparts in Dynamics 365 Customer Engagement (v9). The first of this series will focus on the Xrm.Utility, Xrm.Page.data, Xrm.Page.ui and Xrm.Page.context. I will demonstrate the method calls in Dynamics CRM and how to get the same functionality using Dynamics 365 CE.

The following image shows the new Xrm object model in Dynamics 365 Customer Engagement (v9).

Xrm Object Model

Xrm.Utility

The following table show the most commonly used function in the Dynamics CRM Xrm.Utility class, and the method calls in Dynamics 365 v9.

Dynamics CRM Client APIDynamics 365 v9 Client API
Xrm.Utility.openEntityFormXrm.Navigation.openForm
Xrm.Utility.openQuickCreateXrm.Navigation.openForm 
Xrm.Utility.openWebResourceXrm.Navigation.openWebResource
Xrm.Utility.alertDialogXrm.Navigation.openAlertDialog
Xrm.Utility.confirmDialogXrm.Navigation.openConfirmDialog

Click here to access the reference to the Xrm.Navigation properties and methods in Dynamics 365 CE.
 

Xrm.Page.data

The following table show the most commonly used function in the Dynamics CRM Xrm.Page.data class, and the method calls in Dynamics 365 v9.

Dynamics CRM Client APIDynamics 365 v9 Client API
Xrm.Page.data.getIsValidformContext.data.isValid
Xrm.Page.data.saveforContext.data.save 
Xrm.Page.data.refreshformContext.data.refresh

Click here to access the reference to the formContext.data properties and methods in Dynamics 365 CE.
 

Xrm.Page.ui

The following table show the most commonly used function in the Dynamics CRM Xrm.Page.ui class, and the method calls in Dynamics 365 v9.

Dynamics CRM Client APIDynamics 365 v9 Client API
Xrm.Page.ui.clearFormNotificationformContext.ui.clearFormNotification
Xrm.Page.ui.closeforContext.ui.close 
Xrm.Page.ui.getViewPortHeightformContext.ui.getViewPortHeight
Xrm.Page.ui.getViewPortWidthformContext.ui.getViewPortWidth
Xrm.Page.ui.getFormTypeformContext.ui.getFormType
Xrm.Page.ui.setFormNotificationformContext.ui.setFormNotification
Xrm.Page.ui.refreshRibbonformContext.ui.refreshRibbon
Xrm.Page.ui.navigation.itemsformContext.ui.navigation class methods
Xrm.Page.ui.formSelector.getCurrentItem &
Xrm.Page.ui.formSelector.items
formContext.ui.formSelector class methods



Click here to access the reference to the formContext.ui properties and methods in Dynamics 365 CE. For the formContext.ui.navigation reference, click here. For the formContext.ui.formSelector reference, click here.
 

Xrm.Page.context

The following table show the most commonly used function in the Dynamics CRM Xrm.Page.context class, and the method calls in Dynamics 365 v9. To use the following method your can set the global context by declaring it as a variable as such:
var context = Xrm.Utility.getGlobalContext();
var userId = context.userSettings.userId;

Dynamics CRM Client APIDynamics 365 v9 Client API
Xrm.Page.context.client.getClientcontext.client.getClient
Xrm.Page.context.client.getClientStatecontext.client.getClientState 
Xrm.Page.context.getClientUrlcontext.getClientUrl
Xrm.Page.context.getOrgLcidcontext.organizationSettings.languageId
Xrm.Page.context.getOrgUniqueNamecontext.organizationSettings.uniqueName
Xrm.Page.context.getUserIdcontext.userSettings.userId
Xrm.Page.context.getUserLcidcontext.userSettings.languageId
Xrm.Page.context.getUserNamecontext.userSettings.userName
Xrm.Page.context.getUserRolescontext.userSettings.securityRoles
Xrm.Page.context.prependOrgNamecontext.userSettings.prependOrgName

Click here to access the reference to the global context properties, methods and subclasses in Dynamics 365 CE. 
 

Xrm.Page.data.entity

The following table show the most commonly used function in the Dynamics CRM Xrm.Page.data.entity class, and the method calls in Dynamics 365 v9.

Dynamics CRM Client APIDynamics 365 v9 Client API
Xrm.Page.data.entity.getDataXmlformContext.data.entity.getDataXml
Xrm.Page.data.entity.getEntityNameforContext.data.entity.getEntityName
Xrm.Page.data.entity.getIdformContext.data.entity.getId
Xrm.Page.data.entity.getIsDirtyformContext.data.entity.getIsDirty
Xrm.Page.data.entity.getPrimaryAttributeNameformContext.data.entity.getPrimaryAttributeValue
Xrm.Page.data.entity.saveformContext.data.entity.save

Click here to access the reference to the forContext.data.entity properties and methods in Dynamics 365 CE. 

 

In the next parts of these series I will cover the attributes and controls collections, properties and methods,

 
 
 
 
 
 
 
 
 
 
 
 
 

Comments

*This post is locked for comments