1

Does someone know something about the action execution order please?

I have defined a workflow named Update Access Granted.

And I can see some scheduled actions from Set up -> Monitor -> Time-Based workflow as below.

enter image description here

I just wonder there are two actions which will execute at the same time 16/07/2015.

Will the two actions execute according to the order as the shown on the monitor?

Actually, my two actions will update the same field with different values.

So the execution order is very important to me.

Does anyone has ideas about this?

Thanks in advance.

1

Time-dependent actions aren't executed independently. They're grouped into a single batch that starts executing within one hour after the first action enters the batch. So the sequence for the screenshot you posted is not gauranteed (atleast as per documentation)

Salesforce doesn't necessarily execute time triggers in the order they appear on the workflow rule detail page. Workflow rules list time triggers that use the Before field first, followed by time triggers that use the After field. again sequence is not gauranteed.

You will have to seperate the field updates to fire on two different time triggers. like 0 hours before a certain date and 1 hours after a certain date.This will guarantee a full-proof solution. Now, you can also try 0 hour before and 0 hour after and run few tests but its not documented that this guarantees the sequence.

Also you might want to look into this post which has a good approach to seperate the time triggers in minutes. http://sftipshack.wordpress.com/2013/10/21/the-5-minute-time-based-workflow-or-15-minute-or-30-minute/

  • @Bangad. You told the truth. However, salesforce only allow me to set hours or days offset rather than minutes or seconds based on the date. – yuan Jul 20 '15 at 5:26
  • You are correct. Time triggers don't support minutes or seconds. for now are you setting 0 minutes before and 0 minutes after ? – Amit Bangad Jul 20 '15 at 5:28
  • @Bangad. You mentioned a good point. setting 0 minutes before and 0 minutes after should solve the problem. Right? – yuan Jul 20 '15 at 5:30
  • Yes, its should solve it. But what makes me skeptical is - its not documented. 'Salesforce doesn't necessarily execute time triggers in the order they appear on the workflow rule detail page'. May be you should run few quick tests to confirm and then apply this solution. Also you might wanna look at - sftipshack.wordpress.com/2013/10/21/… – Amit Bangad Jul 20 '15 at 5:35
  • Thanks @Bangad. The blog you provided is really helpful. Just one more question please. The date filed have 12AM for default. But When I using formula DATETIMEVALUE(my_date) to convert date to date time. It becomes 10:00 AM. Do you have any ideas? – yuan Jul 20 '15 at 8:27
1

In general salesforce executed the time based workflow in the order they were received in the queue. If you want an explicit control on the order, just trigger the time triggers with in span of 2 or 1 min intervals(I mean wait for 2 or 1 min one case)

  • Thanks @Goki. So you mean I can add 1 min to one of the actions's execution time, so that they are not executing at the same time? – yuan Jul 20 '15 at 5:28
  • As bangad mentioned try 0Minutes before and 0minutes after and do a quick test. If that doesn't work have an interval of 1 hour, if your ok in delaying the update. – Goki Jul 20 '15 at 6:01
  • Thanks @Goki. :) As mentioned by Bangad, the official documents only mentioned the list order rather than the execution order by saying that "Workflow rules list time triggers that use the Before field first, followed by time triggers that use the After field.". So making one action delay some time might be safer. – yuan Jul 20 '15 at 6:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.