Thanks for the reply. For the web API use i'm trying to use DeleteRecordChangeHistory Action , but all the time i'm getting bad response. Here is my code . i am not sure i'm sending correct parameters. and i didn't see DeleteRecordChangeHistory Action inside of my crm, but it's available in rest builder. Any idea?
Dynamics 365 Online , version 9.0.2
var parameters = {};
var target = {};
target.primarykeyid = ""00000000-0000-0000-0000-000000000000"; // entity id
//target["@odata.type"] = "Microsoft.Dynamics.CRM.entitylogicalname";
//target["@odata.type"] = "Microsoft.Dynamics.CRM.account";
target["@odata.type"] = "account";
parameters.Target = target;
var req = new XMLHttpRequest();
req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/DeleteRecordChangeHistory", 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 === 200) {
var results = JSON.parse(this.response);
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send(JSON.stringify(parameters));
}