Hello,
Trying to set RequiredAttendee and OptionalAttendee to Appointment using REST API.
For example this code:
var entity = {}; entity["activityid@odata.bind"] = "/activitypointers(533e8a14-fe33-e711-810e-c4346bac1938)"; entity["partyid_account@odata.bind"] = "/accounts(d7bd912f-4ee1-e611-8104-c4346bac1938)"; entity.participationtypemask = 5; var req = new XMLHttpRequest(); req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/activityparties", 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) { 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));
I receive error:
"An undeclared property 'activityid' which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values."
How can I add RequiredAttendee and OptionalAttendee to Appointment usin REST API? Could you please share some working code with me?
Thanks in advance,
Alexander
*This post is locked for comments