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
KimberlyJKimberlyJ 

Can I combine multiple validation rules into one validation rule?

I have PE, and I maxed out on my active validation rule limit.  I have three related validation rules that work independently, and I was wondering if I could put them together into one validation rule. I tried putting them together as is but had syntax issues.

AND( Services__c >0,( Product__c =0),  ISNULL(  Services_Product_Involved__c   ))
 
AND(  Support__c  >0,  ISNULL(   Support_Vendors__c    ))
 
AND(Product__c >0,  ISPICKVAL( Product_Manufacturer__c , ""))

Any assistance will be appreciated.
Thanks.

 

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

I didn't test this on my Dev Org so #Safeharbor but how about something like this?

 

OR(
AND(Services__c > 0,
Product__c = 0,  
ISNULL(Services_Product_Involved__c)),
AND(Support__c  > 0,  
ISNULL(Support_Vendors__c)),
AND(Product__c > 0,
ISBLANK(TEXT(Product_Manufacturer__c))))

 

All Answers

Steve :-/Steve :-/

I didn't test this on my Dev Org so #Safeharbor but how about something like this?

 

OR(
AND(Services__c > 0,
Product__c = 0,  
ISNULL(Services_Product_Involved__c)),
AND(Support__c  > 0,  
ISNULL(Support_Vendors__c)),
AND(Product__c > 0,
ISBLANK(TEXT(Product_Manufacturer__c))))

 

This was selected as the best answer
KimberlyJKimberlyJ

Thank you! That worked great. Now I'm trying to put in a date condition and basically I want this rule to work ONLY on opportunities created after 6/6/2012 but it looks like I'm getting an error message if I try to edit an opportunity that was created before 6/6/2012 regardless if the original validation criteria is met or not. There is no syntax error.

 

OR( DATEVALUE (CreatedDate) <DATE(2012,6,6),
OR(
AND(Services__c > 0,
(Product__c <1),
ISNULL(Services_Product_Involved__c)),
AND(Support__c > 0,
ISNULL(Support_Vendors__c)),
AND(Product__c > 0,
ISBLANK(TEXT(Product_Manufacturer__c)))))

 

Thanks.