Hello,
I am trying to update my Nintex Workflow Task with Javascript but i am facing below error:
"Value does not fall within the expected range"
Below is my Javascript which is working fine for SP Designer Workflow Task but not working for Nintex Workfow Task.
function completeTask(id, action)
{
$.ajax({
url:_spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('Tasks')/items(2)",
type: "POST",
data: JSON.stringify({ '__metadata': { 'type': 'SP.Data.TasksListItem' }, 'Title': 'Updated' }),
beforeSend: function (XMLHttpRequest) {
XMLHttpRequest.setRequestHeader("Accept", "application/json; odata=verbose");
},
headers: {
"Accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"IF-MATCH": "*",
"content-type": "application/json;odata=verbose",
"X-HTTP-Method": "MERGE"
},
success: function (data) {
console.log('Item updated');
},
error: function (data) {
var errText = $.parseJSON(data.responseText);
alert(errText.error.message.value);
}
});
}
Is there any limitation or i am doing anything wrong? Any help in this regard will be really appriciated.
Thanks,