Hello everyone.
I have this requirement where I have to pass entity name, GUI and action as a parameter to close the case. But I am not able to execute the code. Could you tell me where I am making a mistake and how should I rectify it.
It is a web API query.
var entityId = "(FBD5D7F4-27CD-E811-9123-00155DDC4BD8)";
var entityName = "incident";
var requestName = "/Microsoft.Dynamics.CRM.rucs_closecase";
var req = new XMLHttpRequest();
req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/" + entityName + entityId + requestName +, 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.onreadystatechange = function() {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 204) {
//Success - No Return Data - Do Something
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send();
*This post is locked for comments