I have an app that updates a list item then starts a workflow on it. It was working fine, then stopped working the other day. It has started throwing an error regarding Taxonomy fields, but I am not changing any taxonomy fields. Here is the code:
var d = $.Deferred(),
oDataUrl = this.appUrl + "/_api/SP.AppContextSite(@target)/Web/Lists(guid'c7c44153-67ad-4189-be89-91b6603ea774')/Items(462)?@target='" + encodeURIComponent(this.hostUrl) + "'",
executor = new SP.RequestExecutor(this.appUrl);
var executeOptions = {
url: oDataUrl,
method: type,
headers: {
"accept":"application/json;odata=verbose",
"content-type":"application/json;odata=verbose",
"X-HTTP-Method":"MERGE",
"If-Match":"*"
},
success: xDomainRequestSuccess,
error: xDomainRequestFail
};
if (dataBody) {
executeOptions.body = JSON.stringify(dataBody);
}
executor.executeAsync(executeOptions);
function xDomainRequestSuccess(data) {
d.resolve((data.body) ? JSON.parse(data.body) : data);
}
function xDomainRequestFail(data, errorCode, errorMessage) {
for (var i = 0; i < Object.keys(data).length; i++) {
console.log(Object.keys(data)[i] + ': ' + data[Object.keys(data)[i]]);
}
d.reject('Failed to perform the request. Error: ' + errorMessage);
}
return d.promise();
Here is the error message:
"code":"-2146232832, Microsoft.SharePoint.SPException"
"value":"Cannot handle the type 'Microsoft.SharePoint.Taxonomy.TaxonomyFieldValue'."
The Stage field is a choice field, and the emailComments a multi line of text field. The list does contain some managed metadata fields, but none are being updated by the app.