Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CloseCaseRecord(itemID) {
- var item = {
- __metadata: {
- type: "SP.Data.CaseRecordListItem"
- },
- CaseStatus: "Closed"
- }
- $.ajax({
- url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('CaseRecord')/items(" + itemID + ")",
- type: "PATCH",
- data: JSON.stringify(item),
- headers: {
- "Accept": "application/json;odata=verbose",
- "Content-Type": "application/json;odata=verbose",
- "X-RequestDigest": $("#__REQUESTDIGEST").val(),
- "X-HTTP-Method": "PATCH",
- "If-Match": "*"
- },
- success: function(data, status, xhr) {
- alert('Case closed successfully');
- location.reload();
- },
- error: function(data) {
- alert(data.responseJSON.error);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement