function Retrievedata()
{
var GUIDvalue = Xrm.Page.data.entity.getId();
alert(GUIDvalue);
var req = new XMLHttpRequest();
req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.0/accounts("+GUIDvalue.slice(1, -1)+")?$select=accountnumber", true);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("Prefer", "odata.include-annotations=\"OData.Community.Display.V1.FormattedValue\"");
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var result = JSON.parse(this.response);
var accountnumber = result["accountnumber"];
alert(accountnumber);
}
else {
alert(this.statusText);
}
}
};
req.send();
}
{
var GUIDvalue = Xrm.Page.data.entity.getId();
alert(GUIDvalue);
var req = new XMLHttpRequest();
req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.0/accounts("+GUIDvalue.slice(1, -1)+")?$select=accountnumber", true);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("Prefer", "odata.include-annotations=\"OData.Community.Display.V1.FormattedValue\"");
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var result = JSON.parse(this.response);
var accountnumber = result["accountnumber"];
alert(accountnumber);
}
else {
alert(this.statusText);
}
}
};
req.send();
}
Useful information. Fortunate me I found your site by accident, and I’m shocked why this coincidence didn’t came about in advance! I bookmarked it.
ReplyDeleteios game development
This comment has been removed by the author.
ReplyDelete