List item stuck in "Pending"
- by Norgean
Problem
simplified:
On
approval, you have an event receiver that changes a field according to some
weird and wonderful business logic. But the item remains in "Pending" state. Why?
First,
you obviously need to turn off the event handling when you change things in the
event receiver. If not, the event receiver will be called because the item
changed. Infinite recursion is a bad thing. But you guessed that.
But
that's not what was wrong. The culprit in my case was that items are set to
require a new approval whenever the item is changed. This is good, but not what
we want in this particular case. So force it back to approved after the other
column has been changed.