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
B D 263B D 263 

Validation Rule with Multiple Record type

Hello,
Below is the valition rule which i have created. The requirement- whenever the stage is set to as 'Closed Lost' , the loss reason need to be mandatory for the different record types mentioned in the rule. 
The rule is not getting triggered and i am able to save opportunity without prompt of the error
Please advice

AND
(ISPICKVAL(StageName, "Closed Lost"),OR ($RecordType.Name = "Lending_Closed",$RecordType.Name = "Non_Lending_Closed",$RecordType.Name = "Non_Lending",RecordType.Name = "Lending"),
ISBLANK(TEXT(Loss_Reason__c)))

Thanks,
BD
Best Answer chosen by B D 263
David Zhu 🔥David Zhu 🔥
You may try the following:

AND
(ISPICKVAL(StageName, "Closed Lost"),
   OR (RecordType.DeveloperName  = "Lending_Closed",
          RecordType.DeveloperName = "Non_Lending_Closed",
          RecordType.DeveloperName  = "Non_Lending",
           RecordType.DeveloperName  = "Lending"),
ISBLANK(TEXT(Loss_Reason__c)))

 

All Answers

David Zhu 🔥David Zhu 🔥
You may try the following:

AND
(ISPICKVAL(StageName, "Closed Lost"),
   OR (RecordType.DeveloperName  = "Lending_Closed",
          RecordType.DeveloperName = "Non_Lending_Closed",
          RecordType.DeveloperName  = "Non_Lending",
           RecordType.DeveloperName  = "Lending"),
ISBLANK(TEXT(Loss_Reason__c)))

 
This was selected as the best answer
Abhi VyasAbhi Vyas
Thanks for your answer (Saving Account
Fil KańczułaFil Kańczuła
Why is RecordType.DeveloperName not available through "insert fields" button --- isn't that weird?