[SalesForce] Refresh formula field in Process Builder

I've just run into an interesting Process Builder issue in a client Professional org. I have reproduced it in a small scale on my dev org. Here is a nonsensical minimal example:

  • I added two text fields to Account called ChangeThis and CopiedHere.
  • I added a formula field to Account called EchoesHere that simply equals the value of ChangeThis.
  • I created a Process that is set not to allow recursion and triggers on edit of Account. The first and only condition is that ChangeThis has changed.
  • The first action is to update ChangeThis to concatenate "!!!" to the end of the same field.
  • The second action (within the same condition) is to update CopiedHere to equal EchoesHere.

So now, if I edit ChangeThis to equal "Hello" in the UI and save, I get:

  • ChangeThis: Hello!!!
  • EchoesHere: Hello!!!
  • CopiedHere: Hello

So evidently Process Builder is only retrieving the formula field value at the beginning of the process, rather than calculating it "live" after any updates. Is there any way to force Builder to refresh the formula field mid-process?

Is this "working as intended"?

Best Answer

It is working as intended.

Since in the process builder, you are updating CopiedHere to equal EchoesHere. and EchoesHere is the formula field, so its value will be reflected after committing of data.

So, during middle of execution EchoesHere = Hello, so as CopiedHere also and after committing,

EchoesHere = Hello!!! (which is same as ChangeThis)

and naturally CopiedHere = Hello (because of formula field condition)

Refer Triggers and Order of Execution

Hope it makes sense!

Related Topic