2

I am trying to start a sharepoint 2010 style workflow which is configured on a list in sharepoint Online. I can't figure out where my problem is - each time I try to start the workflow with code, an error is thrown with the text "itemGuid" of type "System.ArgumentException"

The list is a survey, and I am unable to create sharepoint 2013 style workflows against it. I am able to manually start the workflow via the web browser.

code sample is below:

function testWorkflow_Start(){
    var myListName="MyTestListName";
    var myItemId=1226;
    var context = new SP.ClientContext.get_current();
    var list=context.get_web().get_lists().getByTitle(myListName);
    var item=list.getItemById(myItemId);
    context.load(list,'Id');
    context.load(item);
    context.executeQueryAsync(function(){
        console.log("item uniqueID:"+item.get_item("UniqueId"));
        console.log("listId:"+list.get_id());
        var wfServicesManager = new SP.WorkflowServices.WorkflowServicesManager(context, context.get_web());
        var interopService = wfServicesManager.getWorkflowInteropService()
        interopService.startWorkflow("SRDTest", null, list.get_id(), item.get_item("UniqueId"), null);        
        context.executeQueryAsync(function(){
            console.log("success");
        },
        function(sender,args){
            console.log("Error:"+args.get_message()); //returns: "itemGuid"
        });
    },function (sender,args){
        console.log("error occurred");
    });
}

I've also tried passing in the GUIDs as strings, but I get the same error.

I created a test list and test sp2010-style workflow in our sharepoint 2013 on-prem environment - it produced the same error. In that environment I was able to get the Correlation ID and track down the error in the ULS logs, but it isn't much help to me:

Original error: System.ArgumentException: itemGuid    
 at Microsoft.SharePoint.WorkflowServices.FabricInteropProvider.StartWorkflow(String associationName, Guid correlationId, Guid listId, Guid itemGuid, IDictionary`2 workflowParameters)    
 at Microsoft.SharePoint.WorkflowServices.WorkflowInteropServiceServerStub.StartWorkflow_MethodProxy(WorkflowInteropService target, XmlNodeList xmlargs, ProxyContext proxyContext)    
 at Microsoft.SharePoint.WorkflowServices.WorkflowInteropServiceServerStub.InvokeMethod(Object target, String methodName, XmlNodeList xmlargs, ProxyContext proxyContext, Boolean& isVoid)    
 at Microsoft.SharePoint.Client.ServerStub.InvokeMethodWithMonitoredScope(Object target, String methodName, XmlNodeList args, ProxyContext proxyContext, Boolean& isVoid)

The on-prem ULS Log also shows the request parameters for the CSOM call - which are below:

<Request xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0" ApplicationName="Javascript Library">
    <Actions>
        <ObjectPath Id="33" ObjectPathId="32" />
        <ObjectPath Id="35" ObjectPathId="34" />
        <Method Name="StartWorkflow" Id="36" ObjectPathId="34">
            <Parameters>
                <Parameter Type="String">wfStartTest</Parameter>
                <Parameter Type="Null" />
                <Parameter Type="Guid">{357abe32-faac-4b15-a4ed-a823272e7f66}</Parameter>
                <Parameter Type="Guid">{f3c8da6b-a2bd-48ee-b21e-78a0501cd7d5}</Parameter>
                <Parameter Type="Null" />
            </Parameters>
        </Method>
    </Actions>
    <ObjectPaths>
        <Constructor Id="32" TypeId="{4ccc7f0e-bf7e-4477-999c-6458a73d0039}">
            <Parameters>
                <Parameter ObjectPathId="18" />
            </Parameters>
        </Constructor>
        <Method Id="34" ParentId="32" Name="GetWorkflowInteropService" />
        <Property Id="18" ParentId="16" Name="Web" />
        <StaticProperty Id="16" TypeId="{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}" Name="Current" />
    </ObjectPaths>
</Request>

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.