This project has moved and is read-only. For the latest updates, please go here.

SP2013 - StartWorkflow

Jan 31, 2014 at 7:15 PM

I'm looking to start a list workflow on an item via button press. Per:

I need the template ID of the workflow, but have been unable to obtain this. Using:
    operation: "GetTemplatesForItem",
    item: itemURL,
    async: true,
    completefunc: function (xData, Status) {
        var currentItemURL = this.item;
        $(xData.responseXML).find("WorkflowTemplates > WorkflowTemplate").each(function (i, e) {
            if ($(this).attr("Name") == "Project Kickoff - Test") {
                var guid = $(this).find("WorkflowTemplateIdSet").attr("TemplateId");
                if (guid != null) {
                    wfGUID = "{" + guid + "}";
                    console.log("Template ID: " + wfGUID);
                    //in this point, we have our workflow Id and we have to call the starting method
...successfully returns a SOAP envelope with the proper Web and List data in it, but the workflow templates section is empty. I am able to manually launch the workflow so the association and subscription should be valid.

The plan was to use this function to retrieve the templateID and run the operation "StartWorkflow" from there.

Am I missing a step, or miss-interpreting the expected return here?

Thanks very much.
Feb 3, 2014 at 4:37 PM
I've posted a question at SharePoint Exchange as well for my non-SPServices efforts. They might correspond to the issue above as well, so here's the link to provide more information on the problem I have at hand.

As the end goal is to launch StartWorkflow, perhaps a workaround would be to manually retrieve the template ID. Is there a way to achieve this in SharePoint 2013? It seems that in 2010 the templateID was part of the query string when reviewing the workflow change screen, but now all I see are the list GUID and subscription GUID.

Thanks again.