cancel
Showing results for 
Search instead for 
Did you mean: 
rizwan_akhter
Nintex Newbie

Unauthorized attempt to update workflow task by user nintex.dll

Jump to solution

Hi,

I am trying to complete a Flexi task with c# code. Below is my function:

private void CompleteFlexiTask(SPWeb web, SPList taskList, int actionId, int taskId)
{
try
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{

SPListItem spTask = taskList.GetItemById((taskId));
Guid commentsFieldId = Nintex.Workflow.Common.NWSharePointObjects.FieldComments;
Guid decisionFieldId = Nintex.Workflow.Common.NWSharePointObjects.FieldDecision;
Guid outcome = Nintex.Workflow.Common.NWSharePointObjects.FieldApprovalOutcome;
spTask[decisionFieldId] = actionId;
spTask[commentsFieldId] = "Comments";
spTask[outcome] = 2;
web.AllowUnsafeUpdates = true;
spTask.Update();
web.AllowUnsafeUpdates = false;
}
);
}
catch (Exception ex) { }
}

I want to execute this code with a specific user other than System Account. But i am getting below error even i added this user as site owner and Farm Administrator:

Code only executes when i try to complete it with System Account. Any help would be really appreciated.

Labels: (1)
0 Kudos
Reply
1 Reply
Highlighted
Community Manager Community Manager
Community Manager

Re: Unauthorized attempt to update workflow task by user nintex.dll

Jump to solution

Updating workflow task outside of the task form, task list a d or Express approval (email) is not supported by Nintex. 

 

An option if you must use code would be to update the task item in SharePoint and allowing that update to trigger Nintex and SharePoint to complete the task as it should.

0 Kudos
Reply