Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function presaveaction(){
- modifyColumnToRunEditedWorkflow(ItemID);
- return false;
- }
- function modifyColumnToRunEditedWorkflow(id){
- var clientContext = new SP.ClientContext("site");
- var oList = clientContext.get_web().get_lists().getByTitle('List Title');
- var oListItem;
- oListItem = oList.getItemById(id);
- oListItem.set_item('ColumnToEdit', 'value');
- oListItem.update();
- clientContext.executeQueryAsync(Function.createDelegate(this, updateListItemOK), Function.createDelegate(this, updateListItemError));
- }
- function updateListItemOK() {
- alert('Item updated and workflow is run');
- }
- function updateListItemError(sender, args) {
- alert('Request failed. ' + args.get_message() + 'n' + args.get_stackTrace());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement