Hello all,
We recently updated one of our environment to version 9.0
Since then we have been getting "Bad request" when trying to create a record through javascript.
The exact same code works just fine on the environments we haven't updated.
This is the object we are sending to create an incident record
entity = {
casetypecode: 7,
customerid_account@odata.bind:"/accounts(1AAF570D-A4E4-E711-80F7-3863BB344AC0)",
subjectid@odata.bind: "/subjects(02b48911-69f3-e611-80f5-c4346bad92d0)",
title: "Fourth Coffee (sample)"
}
This is the request
var req = new XMLHttpRequest();
req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/incidents", 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) {
//Never gets here
}
else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send(JSON.stringify(entity));
Are there some modification that I have missed that need to be done for all request to get this working in this version ?
Any help would be greatly appreciated
*This post is locked for comments
I have the same question (0)