Sunday, February 26, 2012

CRM 4.0/2011 "Access is Denied" error message in GenerateAuthenticationHeader()

Access is Denied appear when use an IP address or localhost.

The reason is that your GenerateAuthenticationHeader uses the server name. When you make a request to what is interpreted as a different domain you will get an error.You might try putting your IP address in your Internet explorer trusted sites and then change the IE options to allow cross domain requests, but the simplest solution is to just use the server name when you open Microsoft Dynamics CRM.


Nicola Grillo

Thursday, February 16, 2012

CRM 2011 : Access is Denied error message in Rest Query

This appear when you use an IP address or localhost in CRM Url. The reason is that your REST query uses the server name from the context.getServerURL function. When you make a request to what is interpreted as a different domain you will get an error.

You might try putting your IP address in your Internet explorer trusted sites and then change the IE options to allow cross domain requests, but the simplest solution is to just use the server name when you open Microsoft Dynamics CRM.

The following workaround use the application server name:


Workaround


var serverURL;

try{
serverURL =  getServerUrl()  
}catch(error e)
{
serverURL = document.location.protocol + "//" + document.location.host + "/" + Xrm.Page.context.getOrgUniqueName();
}





Thanks,
Nicola