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
Radhika Balam IBSARadhika Balam IBSA 

Workflow Evaluation Criteria

Hi,

I have a built a workflow to set the value of a fileld 'Commission Start Date' to the date on which the Opportunity is Closed Won.
The evaluation criteria is based on the Stage and the Previous Stage of an Opportunity record. The field should be updated only when the Stage moves from any other value to Closed Won.
But, in a case where there was no change to the Opportunity stage (already Closed Won) but the name of the Account was changed, the workflow is causing the field update and set the Commission Start Date to TODAY (day on which the name of the Account was changed). I am unable to figure out why is this happening.

Can someone please help me with this scenario. Here is a screenshot of my workflow.
Appreciate the help.

User-added image


Thanks!
Peter FribergPeter Friberg
Can't you just select the middle alternative (created, and every time it's edited) only keep the Stage equals 'Closed Won' clause?
Radhika Balam IBSARadhika Balam IBSA
Yes, that will work. But, our instance integrates with multiples systems and Integrations update the Opportunities very often causing 'Closed Won stage to Closed Won'. Just to keep the workflow tight and act only once when the Opportunity is actually Closed Won, I used Prevous Stage as well in my evaluation criteria.

Regarding my post and question, I think I figured out the reason behind and also a resolution.
Will post it here once I test and confirm.
Akhil AnilAkhil Anil
Hi Radhika,

This should be pretty simple. Just follow the below steps and it will ensure that the workflow is fired only once when the Stage value changes from anything else to "Closed Won" irrespective of how many times the record is updated by external integrations. The ISCHANGED() function and PRIORVALUE() function are best used for such scenarios

Evaluation Criteria : Created and everytime it's edited

Workflow entry formula (Select Formula instead of "Criteria Met")
 
AND(
ISCHANGED(StageName),
TEXT(PRIORVALUE(StageName)) <> "Closed Won",
TEXT(StageName) = "Closed Won"
)

That should work !

Kindly mark it as an answer if that works !