SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

enter image description here

This is a sharepoint 2010 custom approval workflow... I am preventing unauthorised person from approving a task. The while activity checks for a flag (_isStateChanged). The flag is set to true inside onApprovalTaskChanged as shown below

private void onApprovalTaskChanged_Invoked(object sender, ExternalDataEventArgs e)
         if ((onApprovalTaskChanged_AfterProperties.AssignedTo.Equals(e.Identity))
            _isStateChanged = true;

Now when i try to approve the task with a user to whom the task was not assigned, the while activity is effectively preventing the remaining activities from getting executed(as required), but the task status is getting updated as 'Completed' with 0 %. How can i set it back to 'Not Started' status.

share|improve this question
up vote 1 down vote accepted

I solved this issue in other way. When the task is created I setup an unique permission for this task like this:

HybridDictionary permsCollection = new HybridDictionary();
permsCollection.Add(taskProperties.AssignedTo, SPRoleType.Contributor);
createTask.SpecialPermissions = permsCollection;
share|improve this answer
thanks! let me try this, i have multiple sharepoint groups and these tasks are assigned to one these groups based on the flow. I assume your solution works in that case also... – Shankar Feb 2 '12 at 8:58
This indeed helped me, thank you very much!!! – Shankar Feb 2 '12 at 12:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.