Salesforce has some great tools to automate our business processes with our human interventions. One of such inventions are WorkFlows which are our today’s topic.
Workflow provide a great flexibility of automating business. A rule with a criteria is needed which does actions such as Field Updates, Sending an Email Alert, Creating a Task and An Outbound Message. These actions will not fire immediately as rule criteria meets but also can be fired upon specific time set by user using Time-dependent Action. Let us dive deep into it.
Workflow Rule Creation Contains 4 Steps:
Step-1: Choosing the object on which workflow needs to setup : In this step, Choose an object on which Workflow action needs to fired on.
Step-2: Identifying which Evaluation criteria to choose depending upon business scenario : This is one of the Key steps to function Workflows as expected. This gives 3 options to choose.
- Created : This Evaluates the rule criteria every time a record is created. If there are any updates to the records, It will ignore.With this option, the rule never runs more than once per record.
- Created, and every time it’s edited : This Evaluates the rule criteria every time a record is created and edited until the record meets the criteria.
- Created, and any time it’s edited to subsequently meet criteria : This Evaluates the rule criteria every time a record is created and updated. for a new record, run the rule if the rule criteria is met.For an updated record, run the rule only if the record is changed from not meeting the rule criteria to meeting the rule criteria.
Step-3: Giving Rule criteria : In this step, rule criteria is set for which workflow actions will fire. This provides 2 options.
- Criteria are Met : In this, select the filter on a field criteria that a record must meet to trigger the rule.
- Formula Evaluates to True : In this, create a formula that returns a value of “True” or “False.” Salesforce triggers the rule if the formula returns “True.”
Step-4 : Adding your WorkFlow Actions
- Immediate Actions : Actions execute as soon as the rule criteria meets.
- Time-Dependent Actions: Actions executed at a specific time.
Considerations for Time Dependent Actions
- They are executed on the Organisation time zone but not on the user’s time zone.
- All the Time-Dependent actions are not executed independently but they are grouped as a batch for execution.
- Time -Dependent Actions cannot be set up with the evaluation criteria “Created, and any time it’s edited to subsequently meet criteria“
- If a record has already met the criteria and Time Dependent action is sent to the workflow queue and if the action is deleted, Record will still be in the workflow queue until you delete the record explicitly.
- If the record in the queue no longer meets the criteria then record gets deleted from the queue.
- If you delete the record which is in the queue, the record is also deleted from the queue.
- If a record has a time set in past then workflow rule will execute with in an hour of workflow creation. for eg: if rule is on opportunity set to fire on 5 days before close date and if the close date is today then workflow will fire with in a hour of its activation.
Article Resource: Propel