function retrieveRecordsSynchronously()
{
var retrieveRecordsReq = new XMLHttpRequest();
var ODataPath = Xrm.Page.context.getServerUrl()
+ "/XRMServices/2011/OrganizationData.svc/AccountSet";
retrieveRecordsReq.open('GET', ODataPath,
false);
retrieveRecordsReq.setRequestHeader("Accept",
"application/json");
retrieveRecordsReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
retrieveRecordsReq.send(null);
var records =
JSON.parse(retrieveRecordsReq.responseText).d;
//Read the first account name
alert('First Account Name is: ' +
records.results[0].Name);
}
Very useful site for all the students and must be shareable site. thanks a lot for the post!!
ReplyDeleteMicrosoft Dynamics AX Training | Microsoft Dynamics CRM Online Training