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
Sid_CSid_C 

Issue with workflow rule criteria "formula evaluates to true"

Hi,
I'm getting an issue where the workflow criteria evaluates to false, as it gets the old value instead of the new one. Has anyone faced this issue or does anyone know if it's the expected behaviour?

Steps:

1) Create 2 record types (A and B) on an object.
2) Create 3 workflow rules to run on creation.
   WF 1: Change the record type from A to B. (Set "Re-evaluate Workflow Rules after Field Change" on the field update)
   WF 2: Update a field X if RT equals B (Use the rule criteria "criteria are met")
   WF 3: Update a field Y if RT.DeveloperName = 'B' (Use the rule crtieria "formula evaluates to true")
3) Create a record with RT A.

Result:
Record created with RT updated to B, and field X updated as per the field update. However field Y is not updated.
Going through the logs I can see that the values for WF 3 show the RT.DeveloperName as A instead of B, even though it works correctly for WF 2 (which displays the ID in the logs).
Shouldn't it work the same way for both?

Hopefully i've managed to keep it as clear as possible.
Hargobind_SinghHargobind_Singh
Hi
Not sure if this helps, but Salesforce doesn't guarantee the workflow rule execution sequence. I suggest not relying on workflow sequence for any logic to be implemented, as this could be erratic. I would usually prefer distributing logic between different initiation units, i.e., triggers and workflows, as Salesforce does guarantee the execution sequence of those. 

And, even if this works on one record, this could fail on another, which is expected. 


=========

ps: If your problem/question is resolved/answered, please mark your post as 'Solved' so that the community can benefit with resolution of issues. 
Sid_CSid_C

My issue is a bit different.

If there are 2 workflows which have a similar criteria (one using "criteria are met" and the other using "formula evaluates to true"), they behave differently, when executed as part of "Re-evaluate Workflow Rules after Field Change".

The workflow with "criteria are met" always takes the new values (changed as part of workflow execution round 1), while the workflow with "formula evaluates to true" takes the original values (before the workflow execution round 1).

Shouldn't it be the same for both?