Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

How to pass a Collection Arguments via startWorkflowOnListItem (javascript)

$
0
0

Hi,

I want pass an 'assignedTo' parameter to my WF via an initiation form, but when I  add an Array() to the Object() wfParams, I get the error :

An error occured when starting workflow. Type 'System.Object[]' with data contract name 'ArrayOfanyType:http://schemas.microsoft.com/2003/10/Serialization/Arrays' is not expected.

I try to change the wfParams type to Array() but after I haven't all the parameters...

Thanks in advance for your help.

JM

var wfParams = new Object();

// get reviewer loginname
var html = $("#ctl00_PlaceHolderMain_docReviewerUser_upLevelDiv");
wfParams['DocReviewerLoginName'] = $("#divEntityData", html).attr("key");

// get editor loginname
var html = $("#ctl00_PlaceHolderMain_docEditorUser_upLevelDiv");
wfParams['DocEditorLoginName'] = $("#divEntityData", html).attr("key");


wfParams['listUsr'] = new Array("xxx", "yyy", "zzz");

...
...

 // Start list workflow
wfManager.getWorkflowInstanceService().startWorkflowOnListItem(subscription, itemId, wfParams);

...
...



Viewing all articles
Browse latest Browse all 8089

Trending Articles