AnsweredAssumed Answered

Nintex workflow task not updating

Question asked by subroto on Sep 15, 2017
Latest reply on Sep 25, 2017 by fhunth

I am trying to use Nintex DLL in my project for some approval task in my project, in a similar manner the Out of the box nintex approval might be using. In Out of the box nintex approval page it updates the Nintex Workflow task list with approval/reject status . I tried this approach and an item in “Nintex Workflow Task” list is getting updated but with “Pending” as status every time I update the list instead of approval. Can someone answer why the changes are not committed after calling the clientContext.ExecuteQuery() method. Please find below the code snippet ::

ListItem item = lists.GetItemById(userTask.SharePointTaskId);
item["ContentTypeId"] = "0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
item.FieldValues["ID"] = 574;
item.FieldValues["Title"] = "Test";
item.FieldValues["ApproverComments"] = "Test Approval";
item.FieldValues["Decision"] = 1;
item.FieldValues["ApprovalOutcome"] = 1;
item.FieldValues["Status"] = "Completed";
item.FieldValues["WorkflowOutcome"] = "Approved";
item.FieldValues["Completed"] = "True";
item.FieldValues["PercentComplete"] = 1.0f;
item.FieldValues["Comments"] = "Test Approval";
item.Update(); // ITEM GETTING UPDATED HERE
clientContext.ExecuteQuery(); // AFTER EXECUTING THIS STATEMENT THE CHANGES VANISHES, AND DO NOT PERSIST

Outcomes