I'm trying to script up a simple button on a display form that triggers a workflow on the item being viewed. I've been through a dozen different posts/tutorials on this and I can almost get it working, but they pretty much all require knowing the workflow's subscription ID in order to work. In earlier versions of SP it was pretty easy to do; You just need to inspect the link that starts the workflow. But in my case, the link simply displays an error message about needing to edit the workflow in SPD.
I've tried looking at it in SPD but it doesn't seem to list anything about the subscriptions. I've also tried getting to it through PowerShell, but the closest I can get is finding the workflow properties from the service proxy, which also doesn't give the subscription ID. I'm at a loss for where to get it. What am I missing here?
For reference, here's a sample of code that requires it:
function StartWorkflow(subscriptionId, itemId) {
showInProgressDialog();
var ctx = SP.ClientContext.get_current();
var wfManager = SP.WorkflowServices.WorkflowServicesManager.newObject(ctx, ctx.get_web());
var subscription = wfManager.getWorkflowSubscriptionService().getSubscription(subscriptionId);
ctx.load(subscription, 'PropertyDefinitions');
...
Edit: Although there is this script which mentions the subscription ID is not the preferred way, but the code in there is a little beyond my comfort zone so I'm not entirely sure how to modify it.
Furthermore, I need to clarify that the workflow I'm targeting is on the 2010 platform, not 2013.