Skip to main content
Nintex Community Menu Bar

Delegate Task web services invoking using Jquery

  • June 9, 2018
  • 1 reply
  • 13 views

Forum|alt.badge.img+3

Hi Team, 

Any one please suggest calling delegate task web services using jquery, getting error  "internal server error". Below is my code and find attached form.

function updateassigntowebservicecall()
{
vdelegated = false;
var vvalidation = true;

$('#lblerrmsg').empty();
var vassignto = $('#ddlDelegate').val();
var vcomments = $('#txtComments').text()

if (vassignto == "**SelectValue**")
{
$('#lblerrmsg').text('Please select Delegate.');
vvalidation = false;
}
if (vcomments == "")
{
$('#lblerrmsg').text('Please select Comments.');
vvalidation = false;
}

if (vvalidation == true) {

if (parseInt(vworkfowtaskid) > 0) {

var new_string = "";
new_string += '<?xml version="1.0" encoding="utf-8"?>';
new_string += '<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:nin="http://nintex.com">';

new_string += '<soap:Header/>';
new_string += '<soap:Body>';
new_string += '<nin:DelegateTask>';
new_string += '<nin:spTaskId>'+ vworkfowtaskid +'</nin:spTaskId>';
new_string += '<nin:taskListName>Workflow Tasks</nin:taskListName>';
new_string += '<nin:targetUsername>' + vassignto + '</nin:targetUsername>';
new_string += '<nin:comments>' + vcomments + '</nin:comments>';
new_string += '<nin:sendNotification>true</nin:sendNotification>';
new_string += '</nin:DelegateTask>';
new_string += '</soap:Body>';
new_string += '</soap:Envelope>';

alert(new_string);
callwebservicesfordelegation(new_string);

}

}

}

function callwebservicesfordelegation(vwebsericebatch) {

var wsUrl = sitefullurl + "_vti_bin/NintexWorkflow/Workflow.asmx";
$.ajax({
type: "POST",
url: wsUrl,
dataType: "xml",
data: vwebsericebatch,
success: function (data, status, req) {
if (status == "success") {
alert("hi");
}
},
contentType: "text/xml; charset=utf-8",
error: function (requestObject, error, errorThrown) {
alert(requestObject.status + " " + error + " " + errorThrown);
}

});
}

1 reply

Forum|alt.badge.img+14
  • Scholar
  • June 11, 2018

the script seems to be correct, so I suspect you do not supply inputs in correct form...

- I do not see you would have populated 'vworkfowtaskid' somewhere

- username (new assignee) has to be provided in a form claim|domainloginname, which doesn't seem to be your case since you take it directly form a dropdown