function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Temple SutfinTemple Sutfin 

Approval Process is randomizing my step actions.

I have an approval process with four approval steps.
Each step, on approval, updates a checkbox that is evaluated in visualforce email alert.  However, despite the order listed in the approval process between step 2 and step 3 being exactly the same, the order in which salesforce is evaluating the two steps is different.  Here is the entire process laid out:

pprover 1 approves
   A box is checked that approver 1 approved
   A picklist is updated (used in a VF page elsewhere, and works just fine)
   An email is sent to approver 2 with specific language (This is a VF template that looks at the box checked above and renders the section appropriate to that approver)

Approver 2 approves
   A box is checked that approver 2 approved
   A picklist is updated (used in a VF page elsewhere, and works just fine)
   An email is sent to approver 3 with specific language (This is a VF template that looks at the box checked above and renders the section appropriate to that approver)

Approver 3 approves
   A box is checked that approver 3 approved
   A picklist is updated (used in a VF page elsewhere, and works just fine)
   An email is sent to approver 4 with specific language (This is a VF template that looks at the box checked above and renders the section appropriate to that approver)

And here is where it breaks down.  The Approver 3 approval steps try to send the email BEFORE the box is checked, so the email template is sending the wrong rendered section.  If I manually check approver 1,2, and 3's boxes and then submit for approval, it works just fine.  So I know that salesforce is checking the boxes before sending the email alerts for the first 2 steps.  But on the third step, it sends the email and then checks the box.  But each approval step is exactly the same.

Anyone come across this issue before?  What did you do to solve it?  Any suggestions are helpful here.

Thanks,
Temple