Wednesday, March 25, 2020

Run - "Time Based Workflow" or "Process Builder" within 60 Minutes or 1 Hour of Record Creation

We mostly get a requirement, to update the field after few minutes of creation of record or send an email after 1 minute of status update of record. 

Salesforce gives only 2 options while creating time based workflow i.e. hours or days. Means if we need that action should be executed within 5 or 10 minutes, it is not possible.




To serve above purpose, we can create a date time formula field "Created Date - 50 Minutes", value = CreatedDate-(50/1440). 

Suppose record was created on 26 March 2020 9:00 AM (03/26/2020 09:00), this formula field will have value 26 March 2020 8:10 AM (03/26/2020 08:10).





Now you can use this field in workflow like below :-





Activate workflow, which will work after 10 minutes from record creation. You can use the same field in process builder as well.

Note : - Time based workflow runs in batch as per salesforce queue, record will be queued after 10 minutes, execution may vary as per salesforce queue execution.