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
acl5acl5 

Workflow Rule triggered by an Approval Process field update?

I've created a workflow rule that is intended to send a series of emails via  time-dependent email alert workflow actions.  The problem I am having is that I need the workflow rule to be triggered based on a field update from an approval process.  i.e., when a request gets approved, the "approved" checkbox on the record gets selected and that should trigger the rule.  The way my rule is set-up now it will trigger if I manually edit the recorde and select the approved box, but if my approval process checks the box the rule is never triggered.  Anything I can do? 
jkucerajkucera

Workflow isn't permitted to trigger workflow, so one way to get around this:

1) Approval process updates the Approved checkbox

2) After update trigger fires and calls an asynchronous Apex method

3) Asynch apex method updates the record

4) 2nd Workflow rule fires, sending the email alert

 

Asynch methods are designated by the @future tag & are called outside the save order, so they can invoke another update, which fires the 2nd workflow rule evaluation.

KalluruKalluru

Hi John,

 

Your Post helps me alot When I am Updating the record Using asynchronous Metod the work flow fires if the approver has Admin ROLE.

If the approver has non Admin privilege as the future metod called after the approval Actions he won't have the access to update it I am getting access denied exception.

 

Thanks,

Praveen

jkucerajkucera

Hmm-I guess you could add a query to the asynch method to find the role of the person who changed the records, and if they don't match approved roles, don't update the lead again.

 

Would that work for you?