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
Sienna Luard 3Sienna Luard 3 

Validation rule to make Competitor Field required when the Reason Lost field has the Value Competitor

Hello, 

We would like to better track who we loose Opps to, so we have created a Lookup field calld Competitor.  This field references a Custom Object called Competitor. 

I want to make this Competitor field required if an Opportunity is Closed Lost with "Competitor" selected in the Reason Lost field. 

Here is what I have come up with:

AND ( 
ISPICKVAL( StageName , "Closed Lost"), 
INCLUDES( Reason_Lost__c , "Competitor") , 
ISNULL( Competitor__c ))

I get no syntax errors, but I can save an Opportunity that has the parameters noted above.

Does anybody have an idea of what I am doing wrong?
Raj VakatiRaj Vakati
Try this
 
AND ( 
ISPICKVAL( StageName , "Closed Lost"), 
INCLUDES( Reason_Lost__c , "Competitor") , 
ISBLANK( Competitor__r.Id ))

OR
 
AND ( 
ISPICKVAL( StageName , "Closed Lost"), 
INCLUDES( Reason_Lost__c , "Competitor") , 
ISBLANK( Competitor__c))

Sienna Luard 3Sienna Luard 3
Hello Raj, 

Thank you so much for your quick response!

Option 1 did the trick. 

I really appreciate your help!

Sienna
Raj VakatiRaj Vakati
Cool! closed this thread !