Is it possible to cancel a save of a list item but still run the workflow. How would I go about doing this?
Example: I save an item in a list. It runs the workflow, but the save item does not appear in the list.
You can do this:
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());
}