validation rule based on amount - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Tatiana ApalboymTatiana Apalboym 

validation rule based on amount

Hi!
I am trying to create a validation where a case cant be created if the opportunity that is realated to it is less than 5k.  Right now I have this validation 
AND (Opportunity__r.Amount<=5000,ISNEW()) 
But someone with no opporunity amount was able to create a case.
Please help!!
Best Answer chosen by Tatiana Apalboym
Steve MolisSteve Molis
Try this
AND (
ISNEW(),
OR(
Opportunity__c,
Opportunity__r.Amount <= 5000,
ISBLANK(Opportunity__r.Amount),
)
)

 

All Answers

Steve MolisSteve Molis
Try this
AND (
ISNEW(),
OR(
Opportunity__c,
Opportunity__r.Amount <= 5000,
ISBLANK(Opportunity__r.Amount),
)
)

 
This was selected as the best answer
Steve MolisSteve Molis
PS.  or if you want to allow them to create a Case without an Opportunity, but bloack them from creating a Case on an Opportunity < $5K you could use
 
AND (
ISNEW(),
NOT(ISBLANK(Opportunity__c)),
OR(
Opportunity__r.Amount <= 5000,
ISBLANK(Opportunity__r.Amount),
)
)

 
Steve MolisSteve Molis
PS   Sorry my first one should have been
AND (
ISNEW(),
OR(
ISBLANK( Opportunity__c ),
Opportunity__r.Amount <= 5000,
ISBLANK(Opportunity__r.Amount),
)
)

 
Tatiana ApalboymTatiana Apalboym
Thank you!! It worked!!! 
Steve MolisSteve Molis
No problem Tatiana, glad it worked for you. And thanks for the + Best Answer Cheers SteveMo