Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. function CloseCaseRecord(itemID) {
  2. var item = {
  3. __metadata: {
  4. type: "SP.Data.CaseRecordListItem"
  5. },
  6. CaseStatus: "Closed"
  7. }
  8. $.ajax({
  9. url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('CaseRecord')/items(" + itemID + ")",
  10. type: "PATCH",
  11. data: JSON.stringify(item),
  12. headers: {
  13. "Accept": "application/json;odata=verbose",
  14. "Content-Type": "application/json;odata=verbose",
  15. "X-RequestDigest": $("#__REQUESTDIGEST").val(),
  16. "X-HTTP-Method": "PATCH",
  17. "If-Match": "*"
  18. },
  19. success: function(data, status, xhr) {
  20. alert('Case closed successfully');
  21. location.reload();
  22. },
  23. error: function(data) {
  24. alert(data.responseJSON.error);
  25. }
  26. });
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement