Advertisement
Guest User

Untitled

a guest
Dec 10th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. function createIoListItem () {
  2. var clientContext = new SP.ClientContext('https://microsoft.sharepoint.com/teams/TrainingSite');
  3. var oList = clientContext.get_web().get_lists().getByTitle('Budget');
  4. var itemCreateInfo = new SP.ListItemCreationInformation();
  5. this.oListItem = oList.addItem(itemCreateInfo);
  6. var popupFields = document.querySelectorAll('#popupOverlay tr:not(:first-child):not(:last-child) select,#popupOverlay tr:not(:first-child):not(:last-child) input');
  7. oListItem.set_item('ClassID', document.getElementById('ctl00_ctl30_g_4f409266_9442_421f_b8cd_0220ded31ba5_ff21_ctl00_ctl00_TextField').value);
  8. oListItem.set_item('Sum', popupFields[0].value);
  9. oListItem.update();
  10. clientContext.load(oListItem);
  11. clientContext.executeQueryAsync(
  12. Function.createDelegate(this, this.ioCreateOnQuerySucceeded),
  13. Function.createDelegate(this, this.ioCreateOnQueryFailed)
  14. );
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement