Guest User

Untitled

a guest
Jul 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. var url= "http://mycompany.sharepoint.com/site1/_api/Web/Lists/GetByTitle('My Library')/Items(7)/file/listitemallfields/ValidateUpdateListItem";
  2. $.ajax(
  3. {
  4. 'url': url,
  5. 'method': 'POST',
  6. 'data': JSON.stringify({
  7. 'formValues': [
  8. {
  9. '__metadata': { 'type': 'SP.ListItemFormUpdateValue' },
  10. 'FieldName': 'NoteCol','FieldValue': 'Test Value'
  11. }
  12. ],
  13. 'bNewDocumentUpdate': true,
  14. }),
  15. 'headers': {
  16. 'accept': 'application/json;odata=verbose',
  17. 'content-type': 'application/json;odata=verbose',
  18. 'X-RequestDigest': $('#__REQUESTDIGEST').val()
  19. },
  20. 'success': function (data) {
  21. console.log(data);
  22. },
  23. 'error': function (err) {
  24. console.log(err.responseJSON.error.message.value);
  25. }
  26. });
Add Comment
Please, Sign In to add comment