function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
fredkafredka 

Can you order your field updates in Workflow

Hi.. Everything that I have found on this topic has been dated.  I have two field updates and I need one to fire before the other.  I strated by trying to build a formula field butthe formula ended up too big so I moved on to workflow field updates.

I know there is the checkbox to re-evaluate the rules if a specific field update changes the field but I wnat to be sure that will work.  My seond field update uses the field in the first field update so I really need them to be ordered properly.

Thank you!!!

Fred
OhadiosOhadios
Hi Fred,

I'm not sure why it would be important for fields to be updated in a specific order- they all get updated in the Sandbox in one single transaction.
I assume that you may have some field value dependant on another and you want to rely on that...
I would recommend trying to find a way around it
for example
- assuming you need to set field b to equal a+1
- but you want to set a first to equal 5
- Why can't you just set be to be 5+1 right away?

Of course, I'm not sure what your specific scenario is.
If you cannot get around the need to set them up in a specific order, you can set two workflows, with the 'second' one having the criteria that the field updated in the first workflow has changed.
Then you must ensure to set the 'Re-evaluate workflow' check so that after the first workflow is completed, it will re-evaluate the need for re-running the second flow (you can't predict the order in which two flows will fire).
Play with this and test it well before you deploy to your users.... 

If you want to share more details about what you are actually trying to accomplish it may be easier to identify a solution.
Finally - have you considered using process builder? You can accomplish a lot more with it than with workflows...

Good luck!
fredkafredka
Thanks for responding!

my first field update uses a case statement to update a field that holds a number.  That tnumber field is then used in the other field update to deduct a specific number of days (my first field holds the number of days) from another date field.

i don't see why your suggestion to split the field updates into different workflows. The second workflow using the first field as the trigger.

you mentioned that I should check the re-evaluate checkbox.   I don't understand why I would need to do that if the second workflow doesn't fire until the first field is changed?

thoughts?

thanks again for helping me!!!

fred