Wednesday 20 May 2015

getServerUrl is deprecated in CRM 2013

Hi,
 
We all know that getServerUrl is deprecated in CRM 2013. Even now, there are many customer who are using CRM 2011. So, while writing the JavaScript we should take some extra care for the code to work in the later versions.
 
var url = "";
if (Xrm.Page.context.getClientUrl) {
   //Post UR 12
   url = Xrm.Page.context.getClientUrl();
}
else {
   //Pre UR 12
   url = Xrm.Page.context.getServerUrl();
}

Hope this helps
 
--
Happy CRM'ing
Gopinath.
 
 

No comments:

Post a Comment