This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function startWorkflow(itemID, subID) { | |
| var context = SP.ClientContext.get_current(); | |
| var web = context.get_web(); | |
| var wfServiceManager = SP.WorkflowServices.WorkflowServicesManager.newObject(context, web); | |
| var subscription = wfServiceManager.getWorkflowSubscriptionService().getSubscription(subID); | |
| context.load(subscription); | |
| context.executeQueryAsync( | |
| function(sender, args){ | |
| console.log("Subscription load success. Attempting to start workflow."); |