Help With StartWorkFlow

Jul 17, 2014 at 4:58 PM
I would like to kick off a SP 2010 workflow associated with a content type. I'm keeping it simple, similar to this:
function StartWorkflow() {
 var itemURL = document.getElementById("txtItemURL").value; 
  $().SPServices({
    operation: "StartWorkflow",
    item: itemURL,
    templateId: "{a2d228d1-5dbb-409d-9055-4ef39ac0033b}",
    workflowParameters: "<root/>",
    completefunc: function(xData, Status) {
        if (Status == "error") {
            alert ("Unable to communicate with Sharepoint Server!");
        } else if ($(xData).hasSPError()) {
            alert("Something went wrong! Sharepoint Error: " + $(xData).getSPError());
            return;
        }
        alert("Finished");
    }
  });
}
The problem is I don't know what the itemURL should be. I've seen examples, but none of them appear to work when I adapt them to my circumstances. I don't know if it's significant, but the workflow is associated with a library, not a list.

Any help would be appreciated.

--Tim (From Boston)
Coordinator
Jul 19, 2014 at 7:14 AM
Tim (from Boston):

With a Document Library, the itemURL should be something like this:
http://servername/Shared Documents/doc123.doc
where the doc123.doc file is in the Shared Documents library in the root site.

M.
Jul 22, 2014 at 4:47 PM
Thanks, Marc!

That's exactly what I needed to know.

--Tim
Coordinator
Jul 23, 2014 at 8:47 AM
Great!

M.