Solved

StartWorkflowOnListItem not showing start form


This is probalby an easy question, but when starting a workflow using the StartWorkflowOnListItem via javascript, the start form doesn't appear. It just runs the workflows without showing the start form. Is there a way to show the start form? The start form variable is a list of users and the workflow simply sends them a notification.

 

Note: it does start the workflow and returns success. 

 

I wasn't able to find anything that address my issue. Here is my function.

 

function startNotificationWorkflow(wfName, itemId, listName) {

var associationData = '';
var webMethod = _spPageContextInfo.webAbsoluteUrl + '/_vti_bin/NintexWorkflow/Workflow.asmx';
var soap = "<?xml version=""1.0"" encoding=""utf-8""?>" +
"<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=""http://www.w3.org/2001/XMLSchema" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/">" +
"<soap:Body>" +
"<StartWorkflowOnListItem xmlns=""http://nintex.com">" +
"<itemId>" + itemId + "</itemId>" +
"<listName>" + listName + "</listName>" +
"<workflowName>" + wfName + "</workflowName>" +
"<associationData></associationData>" +
"</StartWorkflowOnListItem>" +
"</soap:Body>" +
"</soap:Envelope>";

$.ajax({
type: "POST",
url: webMethod,
beforeSend: function (xhr) { xhr.setRequestHeader("SOAPAction", "http://nintex.com/StartWorkflowOnListItem"); },
data: soap,
contentType: "text/xml; charset=utf-8",
dataType: "xml",
success: function (data) {
alert('success');
},
error: function (requestObject, error, errorThrown) {
alert(requestObject.status + " " + error + " " + errorThrown);
}

});
}

icon

Best answer by Tarf 5 May 2021, 10:00

View original

2 replies

Badge +8

Hi @skjones,


thats what the associationData parameter is for, see https://help.nintex.com/en-US/sdks/SDK2013/Reference/SOAP/NW_REF_SOAP_StartWorkflowOnListItem.htm and https://help.nintex.com/en-US/sdks/SDK2013/Operational/SDK_NW_OPS_WorkflowsAssocData.htm 


When starting a workflow using javascript, there is no graphical interface you could show the user. You´d need them to enter the list of users beforehand so you can pass it in your web-service call to start the workflow.

Thanks for the reply! That's what I thought! 🙂

Reply