Xrm.Page.context.getServerUrl() does not work in CRM 365

As part of the test stage in our migration from CRM 13 to CRM 365, we noticed that all the scripts that were doing API calls in JavaScript were not working. After doing an analysis of the code, we detected that there was a method that was not being detected by the XRM object model, this is:

Xrm.Page.context.getServerUrl();

Navigating on internet, I found that this line is deprecated for Online versions and it can be replaced with:

Xrm.Page.context.getClientUrl();

With this change, all of our API calls went back to work perfectly. If you have this issue, just do the change I mentioned above and you’ll be ready to go!

 

Hope it helps!

 

 

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s