1

I would like to push a specific SPListItem to the final step in a State workflow, skipping all the intermediate steps (if a certain checkbox is checked).

Currently, I have an event receiver hooked up to a Task List to intercept when a user tries to push the item to the next step in the workflow. The goal is, if the user checked a special box in that item, I want to push it to the final step of the workflow, if the box isn't checked, I want to let it continue on its way through the workflow.

I didn't create this workflow nor do I have access to its source code. I am looking for a way to "patch it", or to circumvent its current functionality by making the item skip to the final step.

Any suggestions?

1 Answer 1

0

I am not sure if this solution will work for everyone, but what I did was grabbed the item and set the item's Task Status field to "Completed". According to the workflow that the item was using, having a Task Status of "Completed" tells the workflow that the step is done and its time to start the next step.

So if you can determine which field the workflow looks at to determine if the current step is finished or not, set that to "Completed" or whatever notation the workflow uses, that should complete that task and start the next one. Conveniently, it was easy for me to determine which field the workflow looked at since it was called Task Status and it was a choice column where I could see all the possible values that it accepts and "Completed" was the most obvious choice. I hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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