SpServices Starting a Workflow - Is ItemURL and ID necessary

Nov 21, 2013 at 11:04 AM
Hello -

Question on SPServices and StartWorkflow .... Is it required to have an itemURL and itemID (forgive casing on parms) ?

I have a manual workflow on a list that has one initiation parmeter that is a key to use for finding and updating a record within the list (Update List Item).

The workflow does not have to run against a specific ID as the workflow will use the key value of the init param ...

Is it possible to leave the itemURL and itemID out of StartWorkflow?

I suppose I could feed in any ID ... but would prefer not to ...

Thanx!
Jeff
Coordinator
Nov 21, 2013 at 6:53 PM
Jeff:

The operation's requirements are determined by the underlying Web Services, i.e., Microsoft. You can try it, but as I remember those parameters are required.

M.
Nov 22, 2013 at 6:58 PM
Thank you for the feedback Marc ...

Follow up question if I may ...

From the results in the list, I see that I am executing the workflow against the ID (15) used for the "item" .. however .. I keep receiving back "Exception of Type ... was thrown" and an error in SP for the workflow result in the view ...

There are two init params on the workflow ... One has a default value .. the other I pass in as a key ...

Have you seen teh Exception of Type error before?

var key = "Jeff";

    alert ("key value = " + key);


var wfParms = "<Data><p_serialization>" + key + "</p_serialization></Data>"
    alert("wfParms = " + wfParms);
//---------------------------------------------
// Invoke workflow for random Item ID ... passing in the parm
$().SPServices({
operation:"StartWorkflow",
async: true,
item:"https://server.company.com/sites/Ops/zDev/Lists/Status_Tracking_Metrics/15_.000",
debug:true,
templateId: "{e718f487-1523-4666-908f-1fe663a8c25c}",
workflowParameters: wfParms,
completefunc: function(xData, Status) {
alert(xData.responseText);
  }
});

Coordinator
Nov 27, 2013 at 5:01 PM