Function

$().SPServices

Web Service

Workflow

Operation

GetTemplatesForItem

Example

Here's an example provided by nrahlstr. Thanks, Nathan!
var workflowGUID = null;
$().SPServices({
  operation: "GetTemplatesForItem",
  item: itemURL,
  async: false,
  completefunc: function (xData, Status) {
    $(xData.responseXML).find("WorkflowTemplates > WorkflowTemplate").each(function(i,e) {
      // hard coded workflow name
      if ( $(this).attr("Name") == "Workflow Name" ) {              
        var guid = $(this).find("WorkflowTemplateIdSet").attr("TemplateId");        
        if ( guid != null ) {
          workflowGUID = "{" + guid + "}";
          }
        }
      });
  }
});

Last edited Nov 3, 2010 at 9:00 PM by sympmarc, version 1

Comments

nigiyanakaDave Jun 25, 2015 at 4:27 PM 
Hi
Please give and example of ItemUrl ? I have tried.. but didn't work
1. /.../sites/abc/DummyReportLib/Forms/DispForm.aspx?ID=29
2. 1. /.../sites/abc/DummyReportLib/29_.000

Pls Help

hlev80 Aug 15, 2012 at 7:15 AM 
@SPTechQ answer to your first question: http://api.jquery.com/child-selector/

SPTechQ Jul 13, 2012 at 9:07 PM 
What are you doing with the "WorkflowTemplates > WorkflowTemplate" line of code ?

SPTechQ Jul 13, 2012 at 9:07 PM 
Can you please explain and give an example of what a ITEMURL is ?