"No Transport" error while updating record using JSON in Dynamics CRM 2011
"No Transport" error while doing CRUD operations through ODATA is due to Server URL that is been picked up by xrm.page.context.getserverurl().
For example if you are browsing CRM website using a localhost and using xrm.page.context.getserverurl() it always picks up your serverurl based on what is been stored in database infact what is been used while creating organization for example say instead of accessing as http://localhost/CRMOrgname it may give http://myhost/CRMOrgName
Which is treated by javascript as cross domain and does not allow and says No Transport Error.
Instead og using
var orgURL = xrm.page.context.getserverurl()
USE THIS
var orgURL= "http://" + window.location.host + "/" + Xrm.Page.context.getOrgUniqueName();
which always based on what is the current URL that is been used to browse the CRM org now.
Hope this helps
No comments:
Post a Comment