Возможно, вам придется добавить кавычки в нижнюю строку
note["incidentid@odata.bind"] ="/incidents(FC8F144E-06E7-E711-80C7-0050569B0E28)";
Вот код ниже, который я пробовал и хорошо работал для меня.
var entity = {};
entity.subject = "Test from WEbapi 3";
entity.filename = "File Name 123";
entity["objectid_incident@odata.bind"] = "/incidents(C86A8897-D94F-E911-A82F-000D3A385A1C)";
var req = new XMLHttpRequest();
req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v9.1/annotations", false);
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) {
var uri = this.getResponseHeader("OData-EntityId");
var regExp = /\(([^)]+)\)/;
var matches = regExp.exec(uri);
var newEntityId = matches[1];
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send(JSON.stringify(entity));