Hello,
I'm looking to start a list workflow on an item via button press. Per:
http://spservices.codeplex.com/wikipage?title=StartWorkflow
I need the template ID of the workflow, but have been unable to obtain this. Using:
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.
I'm looking to start a list workflow on an item via button press. Per:
http://spservices.codeplex.com/wikipage?title=StartWorkflow
I need the template ID of the workflow, but have been unable to obtain this. Using:
$().SPServices({
operation: "GetTemplatesForItem",
item: itemURL,
async: true,
completefunc: function (xData, Status) {
var currentItemURL = this.item;
console.log(xData.responseXML);
$(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.