Think. Build. Salesforce Solutions.

Salesforce Consulting Services across Salesforce Clouds & Across App Lifecycles

Blog

Time Dependent Workflow for less than an hour

By |2020-06-24T08:53:33+00:00May 24th, 2016|Tags: , , , |

Workflow

Workflow is an automated process to implement the business logic, that evaluates the record at the time of creation or update. It is one of the most powerful tools of Salesforce.

Why necessary??
Workflow becomes indispensable to organizations for maximizing efficiency in their business processes. It allows tracking of processes.

Time-dependent workflow has the following actions:-

1) New Email Alert.

2) New Field Update.

3) New Outbound message.

4) Select existing actions.

The existing actions again have the following actions:

a) Email Alert.

b) Field Update.

c) Outbound message.

Values such as days and hours only are supported by Salesforce for Time-dependent workflows. The minimum value for them is 1. What if we get a requirement in which we need to send a mail just after 10 minutes or 20 minutes of a record creation? Well, Time based workflows have 1 hour as the minimum duration to fire the workflow. In this case, we need to by-pass this limitation. For this, we need to use a particular technique. This requires us to write a custom formula field that calculates Date/Time value. Let us create a formula field as Trigger Time 20.

This formula field actually saves Date/Time value to your record which is 40 minutes in the past. If you save the record at 2:00 pm then the value in the “Trigger Time 20” will be 1:20 pm.
The formula for the Trigger Time 20 is:-

Trigger Time20 = (now () 0.02764)

So now we need to create a time-based workflow rule that fires 1 hour after Trigger Time 20. So 1 hour after a time which was 40 minutes ago, is 20 minutes from now.
This formula field will be accessible to all users but need not be present in the layout.
Here is the chart which shows the values needed to be subtracted from now() function for each 5 minutes interval:-
Value in formula Minutes ago will fire in (minutes)
0.04145600
0.03800555
0.03455 10
0.0310915
0.027644020
0.0241825
0.0207330
0.0172735
0.01382 20 40
0.0103645
0.00691 50
0.0034555
0.0006959

4 Comments

  1. albertson July 31, 2020 at 5:03 pm - Reply

    This is a great blog.

    • Mirketa Inc August 12, 2020 at 8:39 am - Reply

      Thanks, Albertson

  2. Hritank Ovnazar August 11, 2020 at 8:50 pm - Reply

    Great news once again!

    • Mirketa Inc August 12, 2020 at 8:39 am - Reply

      Thanks for the feedback

Leave A Comment