var taskItemmetadata = {
'__metadata': { 'type': $scope.wrkflstNameItemType },
'Status': 'Completed',
'PercentComplete': 1,
'Task_x0020_Outcome': 'Approved'
};
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('" + ListName + "')/items(" + ItemID + ")",
type: "POST",
contentType: "application/json;odata=verbose",
data: JSON.stringify(taskItemmetadata),
headers: {
"Accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"X-HTTP-Method": "MERGE",
"If-Match": "*"
},
success: function (data) {
//alert(data.d.ID);
console.log('Task Approved');
},
error: function (data) {
alert("Error");
}
});
No comments:
Post a Comment