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

Help With StartWorkFlow

Jul 17, 2014 at 5: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; 
    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());
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)
Jul 19, 2014 at 8: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.

Jul 22, 2014 at 5:47 PM
Thanks, Marc!

That's exactly what I needed to know.

Jul 23, 2014 at 9:47 AM