web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

D365 V9{Upgrade}: Client API Change for openEntityForm

AjitPatra Profile Picture AjitPatra 469

Prior to D365 V9, we were using Xrm.Utility.openEntityForm() to open an existing record or to open a create form of an entity providing some additional parameters. However, in D365 V9 as it has been deprecated, we need to use Xrm.Navigation.openForm() to perform the same operation.

Here’s an example of the change in API along with it’s parameters.
D365 V8:


var windowOptions = {
openInNewWindow: true
};
Xrm.Utility.openEntityForm("entity_name", "record_id", null, windowOptions);

D365 V9:


var windowOptions = {
openInNewWindow: true,
entityName: "entity_name" ,
entityId: "record_id"
};
Xrm.Navigation.openForm(windowOptions);

While creating a new record, we can pass values to the attributes using an object which is optional. Please see below sample:


var windowOptions = {
openInNewWindow: true,
entityName: "entity_name"
};
var formParameters = {};
formParameters["attr_1"] = "value_1";
formParameters["attr_2"] = "value_2";
formParameters["attr_3"] = "value_3";

Xrm.Navigation.openForm(windowOptions, formParameters);

Hope it helps!!


This was originally posted here.

Comments

*This post is locked for comments