+ Start a Discussion
Navneeth RajNavneeth Raj 

About Formula in Validation rule

AND(Price__c>15,Quantity__c>4)
This Validation rule accepts Price bt won't accept Quantity as shown in image attached.
Is this formula correct or suggest me formulas for making it valid.User-added image
Best Answer chosen by Navneeth Raj
Mudasir WaniMudasir Wani
See if you want the error to be thrown whether price is greaterthan 15 or quantity is greaterthan 4 then you need to use Or operator.
In above case it is saving data because price is lessthan 15.
Remember It will throw error on AND operation only.
USE below validation to check.
OR(Price__c>15,Quantity__c>4)

Thanks
 

All Answers

Mudasir WaniMudasir Wani
Hi Navneeth,

Your validation rule will throw error only when the Price is more than 15 and quantity morethan 4 what is your actual requirement.
Navneeth RajNavneeth Raj

My requirement here is if Price>15 and Quantity>4 it should throw error but only Price throws error if it is >15 and Quantity won't throw error if it is >4 as shown in the image attached above
Mudasir WaniMudasir Wani
See if you want the error to be thrown whether price is greaterthan 15 or quantity is greaterthan 4 then you need to use Or operator.
In above case it is saving data because price is lessthan 15.
Remember It will throw error on AND operation only.
USE below validation to check.
OR(Price__c>15,Quantity__c>4)

Thanks
 
This was selected as the best answer