+ Start a Discussion
KimberlyJKimberlyJ 

Am I using REGEX correctly?

I have Professional Edition.

I need a validation rule if the name of the object is NOT EQUAL to "Labor" then the Profit field needs to be required.  I think I did it backwards, but it wont force someone to fill in the Profit field if the name is not "Labor".

 

AND(REGEX(Name, "Labor"))

&&(Profit_c)>0

 

This works great!

But if the name is not Labor, i need Profit to be >0. It wouldn't take <> in front of "Labor".

 

Am I going about this all backwards?

Thanks.

Best Answer chosen by Admin (Salesforce Developers) 
Navatar_DbSupNavatar_DbSup

Hi,

Try the below formula in validation rule:

If(Name <>"Labor", ISBLANK(Profit__c ) ,false)

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.