D365 V9{Upgrade}: Client API Change for openWebResource

Prior to D365 V9, we were using Xrm.Utility.openWebResource() to open a web resource in a new window. However, going forward in D365 V9 we need to use Xrm.Navigation.openWebResource() to perform the same operation. Let’s take an example:

D365 V8:


var customParameters = encodeURIComponent("parameter1=value1&parameter2=value2&parameter3=value3");
Xrm.Utility.openWebResource("name_of_webresource", customParameters, 620, 600);

//Xrm.Utility.openWebResource(webResourceName,webResourceData,width, height)

D365 V9:


var customParameters = encodeURIComponent("parameter1=value1&parameter2=value2&parameter3=value3");
var windowOptions = { height: 600, width: 620}
Xrm.Navigation.openWebResource("name_of_webresource", windowOptions, customParameters);

Hope it helps !!

Advertisement

3 thoughts on “D365 V9{Upgrade}: Client API Change for openWebResource

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.