SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

I have a SharePoint 2010 workflow that creates a task. The task has custom form and custom code executed when the form is submitted.

Inside the code I'm trying to set the Completed Status on the task when some conditions are met:

SPListItem taskItem = this.workflowProperties.TaskList.GetItemById(...);
taskItem["Status"] = "Completed";

I get this error:

This task is currently locked by a running workflow and cannot be edited

There are a lot of hits on this when you do a search and lots of fixes (workarounds?!).

My question is, what's the correct (or by the book) solution for fixing this?

share|improve this question

This explains it in a clear way, along with the solution :

share|improve this answer
up vote 0 down vote accepted

I eventually went for adding a UpdateTask activity in my workflow to update the properties I was interested in. It didn't involve any workaround code and I never got the "This task is currently locked by a running workflow and cannot be edited" since then.

share|improve this answer
Hi I'm experiencing the same problem on my production server. Could you kindly explain how to use the 'update task activity' Should I use powershell? and what atribute? Code would help explain. Thanks – Raj Chahal Apr 23 '13 at 7:43

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.