I have two workflows on an Object. I want Workflow-2 to always evaluate/run after the Workflow-1. Once the Workflow-2 is completed then Workflow -1 should be evaluated.
Is there a way to control the order of execution ?
Answer
While there is no native way to handle this, one could hack something together using custom fields. You could add a number field, Workflow_order__c
or similar, and use it to chain your workflows together.
To do so:
- Start off with
Workflow_order__c
set to 0. - Have workflow 1 check
Workflow_order__c = 0
in its criteria - Have workflow 1 update
Workflow_order__c
to 1 - Have workflow 2 check
Workflow_order__c = 1
in its criteria - Repeat as necessary
- Have the last workflow reset
Workflow_order__c
to 0
Another option would be to just use a checkbox, if you only to kick off one additional workflow, but a number field gives you greater flexibility.
Update
As sfdcfox points out below, there are some limitations to this method:
- You must have “Re-evaluate Workflow Rules after Field Change” enabled
- Your maximum depth is five (5) workflows chained together
Attribution
Source : Link , Question Author : amidstCloud , Answer Author : Mike Chale