Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createIoListItem () {
- var clientContext = new SP.ClientContext('https://microsoft.sharepoint.com/teams/TrainingSite');
- var oList = clientContext.get_web().get_lists().getByTitle('Budget');
- var itemCreateInfo = new SP.ListItemCreationInformation();
- this.oListItem = oList.addItem(itemCreateInfo);
- var popupFields = document.querySelectorAll('#popupOverlay tr:not(:first-child):not(:last-child) select,#popupOverlay tr:not(:first-child):not(:last-child) input');
- oListItem.set_item('ClassID', document.getElementById('ctl00_ctl30_g_4f409266_9442_421f_b8cd_0220ded31ba5_ff21_ctl00_ctl00_TextField').value);
- oListItem.set_item('Sum', popupFields[0].value);
- oListItem.update();
- clientContext.load(oListItem);
- clientContext.executeQueryAsync(
- Function.createDelegate(this, this.ioCreateOnQuerySucceeded),
- Function.createDelegate(this, this.ioCreateOnQueryFailed)
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement