13. Dezember 2012 16:28
function GetAttributeValueWithOData(sSelectstatement){
var serverUrl = "http://" + window.location.host + "/" + Xrm.Page.context.getOrgUniqueName();
// Creating the Odata Endpoint
var oDataPath = serverUrl + "/XRMServices/2011/OrganizationData.svc";
var retrieveReq = new XMLHttpRequest();
var Odata = oDataPath + sSelectstatement;
retrieveReq.open("GET", Odata, false);
retrieveReq.setRequestHeader("Accept", "application/json");
retrieveReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
retrieveReq.send();
if (retrieveReq.readyState == 4 /* complete */) {
var retrieved = this.parent.JSON.parse(retrieveReq.responseText).d;
return retrieved.results[0];
}
}
GetAttributeValueWithOData("/ContactSet?$select=EMailAddress1&$filter=ContactId eq guid'" + kundeid + "'").EMailAddress1
13. Dezember 2012 17:03
13. Dezember 2012 17:28
13. Dezember 2012 17:47