Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.