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
Jessica Louttit 22Jessica Louttit 22 

Rule to require a reason for Opportunities going to a 'Target' stage

I have a stage on my opportunity object called, "Target". I would like to create a rule that requires users to populate a field called, 'Return to Target' when an opportunity stage moves from another other stage to Target. I do not want the rule to trigger if the opportunity is being created at Target. 

I created this validation rule, 'AND ( 
ISBLANK(TEXT( Target_Return_Reason__c )), 
ISPICKVAL(StageName,"Target"),NOT(ISNEW()))'

However, it is prompting an error when creating an opportunity in Target because I have process builders that populate the Opportunity Close Date and Close Quarter. Because I cannot change the order the automations trigger, I cannot stop this error from occuring. Does anyone have any ideas on how to meet my requirements?

Thanks!
Waqar Hussain SFWaqar Hussain SF
AND ( 
ISBLANK(TEXT( Target_Return_Reason__c )), 
ISPICKVAL(StageName,"Target")
)

use above text, and let me know, If this does not work for you.
Deepak GulianDeepak Gulian

Use this formula to achieve your requirement

AND( 
ISBLANK( TEXT( Target_Return_Reason__c ) ), 
ISCHANGED(StageName), 
ISPICKVAL(StageName , 'Target') 
)