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 that makes a field required if you want to save an opportunity as closed won if it is a certain record type

I have created the following formula for a validation rule that requires a field to be filled in before saving an Opportunity as Closed Won

AND(ISPICKVAL(StageName, "Closed Won"),
ISNULL( Opportunity_Contract_Date__c ))

This rule works fine, but our use case has become a bit more complex.  This rule now needs to apply to only 1 Opportunity Type.

How should I update the rule so that this field is required to move Opportunities that are a certain record type to Closed Won?
Best Answer chosen by Sienna Luard 3
Raj VakatiRaj Vakati
Use this one 
AND( 
ISPICKVAL(StageName, "Closed Won"), 
$RecordType.Name = "The RecType Name", 
ISNULL( Opportunity_Contract_Date__c ))

 

All Answers

Raj VakatiRaj Vakati
Use this one 
AND( 
ISPICKVAL(StageName, "Closed Won"), 
$RecordType.Name = "The RecType Name", 
ISNULL( Opportunity_Contract_Date__c ))

 
This was selected as the best answer
Raj VakatiRaj Vakati
Use this if you have had more than one record type and stage values 
AND( 
OR (
ISPICKVAL(StageName, "Closed Won"), 
ISPICKVAL(StageName, "Closed Lost "))
OR( 
$RecordType.Name = "The RecType Name", 
$RecordType.Name = "The RecType Name"
)

ISNULL( Opportunity_Contract_Date__c ))

 
Sienna Luard 3Sienna Luard 3
Thanks so much Rajamohan!  

Your formula worked perfectly!

I really appreciate your help. (-: