+ Start a Discussion
yvk431yvk431 

Trigger not firing for the approval

We have an approval process which needs to be approved by 2 unanimous approvers. We also have a field update which will get updated only if both of the unanimous approver approve the record.

 

Before approving the recording we need to check for certain  fields and do not allow bolank values for them.

 

We have an update event trigger on the object ,  this trigger was only getting fired after the second aprover approver but no for the first approver's approval. THis is quite understandable as the field update triggers only after the second approver's approval.

 

My question is how to fire the trigger for the first approval or there is any kind of work around for this scenario.

bob_buzzardbob_buzzard

Does your field get updated as a final approval action then?

 

This sounds like you'll need an action on the approval step itself.  Could you increment a hidden counter on the object itself?  That way you can take additional action on the first approval (i.e. when the counter transitions from 0 to 1) but not for the second (and final) approval.

yvk431yvk431

Yeah, I thought of this approach and tried to implement by using a checkbox , but as since we are having 2 unanimous approvers the action will get fired only upon the completion of the 2 approvers approval.

 

Also we want the trigger to get fired before the approval not after the approval . Any ideas ?

bob_buzzardbob_buzzard

Hmm.  That's a shame.  The only thing I can think of at the moment is to handle the approval programmatically and use a Visualforce page for this.  That's quite a lot of work and a maintenance headache though. 

yvk431yvk431

I am so sirprised to hear this , it seemed so simple, but now its lot of work , thanks bob, atleast you saved our time instead of trying  for this approach.

bob_buzzardbob_buzzard

That doesn't mean there isn't another way to do it though, it just means that I can't suggest one :)

yvk431yvk431

if you cant, means i better do not touch it , and simply escalate it some other person :)

GoForceGoGoForceGo

So to confirm, is you require approval of 2 people unanimously, is there no way of trapping the event that one of them has approved it? You cannot update any fields on the object itself?

 

 

GoForceGoGoForceGo

 

Doesn't seem like you can fire a field update/trigger when one of the 2 approvers in unanimous approval does something.

 

I have posted an idea - please vote. http://success.salesforce.com/ideaView?id=08730000000iu7yAAA