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
KavitaKavita 

Need help with a validation rule

Can someone help me write a validation rule for this scenario please? I have tried various versions but they're just not working out.

 

I have a picklist called "Term" and the values are 12,36 and 48

I have a number field called Qty.

 

I need a validation rule that says if value=12 then qty should be greater than 1 but less than 12.

 

Thanks in advance

Best Answer chosen by Admin (Salesforce Developers) 
MarkSilberMarkSilber
The validation rule below assumes the Qty field is required on the page layouts and isn't checking for null values.

AND(ISPICKVAL(Term__c,"12"),OR(Qty__c < 2,Qty__c > 11))

 

Hope this helps.

All Answers

MarkSilberMarkSilber
The validation rule below assumes the Qty field is required on the page layouts and isn't checking for null values.

AND(ISPICKVAL(Term__c,"12"),OR(Qty__c < 2,Qty__c > 11))

 

Hope this helps.
This was selected as the best answer
KavitaKavita

awesome. Thanks so much.