Monday, July 28, 2014

Retrieve Host and Organization name dynamically in MS CRM through JavaScript

While we are writing any OData query in MS CRM, we have to retrieve the host and orgnization urls dynamically so that when ever code moves to staging or production, code will works withoug any modifications.

To retrieve host :

var host = location.host;

Organization Name:

var org= Xrm.Page.context.getOrgUniqueName();

No comments:

Post a Comment