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
Nikhil Tripathi 13Nikhil Tripathi 13 

Created two validation rules and want to club them under 1 Validation Rule

Hi Team,

I have created two vaildation rules that are working completely fine but i want to club them inside one validation.
The formulas that I have used under these two Validation rules are below:
  1. AND(NOT(Closed_At_Customer_End__c) , (ISPICKVAL(Status__c, 'Closed')) )
  2. AND( Closed_At_Customer_End__c , ISNULL( Customer_End_closed_Date__c ) )
Closed at customer end is a checkbox type, status picklist and and Customer_End_closed_Date__c as date field.
Any help will be highly appreciated
Best Answer chosen by Nikhil Tripathi 13
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Nikhil,

I have clubed two validation rules. Can you test this.
OR( AND(NOT(Closed_At_Customer_End__c) , (ISPICKVAL(Status__c, 'Closed')) ),
AND( Closed_At_Customer_End__c , ISNULL( Customer_End_closed_Date__c ) ))

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
hi Nikhil,

Do you mean if Closed_At_Customer_End__c is not checked then Status__c should not be Closed and Closed_At_Customer_End__c is checked then Customer_End_closed_Date__c should not be null?

Thanks,
 
Nikhil Tripathi 13Nikhil Tripathi 13
If users selects status to closed and closed at customer end is not checked , the validation rule should fire asking user to check the Closed_At_Customer_End__c.
If Closed at customer end is checked  then then Customer_End_closed_Date__c should not be null
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Nikhil,

I have clubed two validation rules. Can you test this.
OR( AND(NOT(Closed_At_Customer_End__c) , (ISPICKVAL(Status__c, 'Closed')) ),
AND( Closed_At_Customer_End__c , ISNULL( Customer_End_closed_Date__c ) ))

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
This was selected as the best answer
Shri RajShri Raj
AND(
OR(
AND(NOT(Closed_At_Customer_End__c), ISPICKVAL(Status__c, 'Closed')),
AND(Closed_At_Customer_End__c, ISNULL(Customer_End_closed_Date__c))
),
)

This will check if either of the two conditions are true and return an error if either one of them is true.

 
Nikhil Tripathi 13Nikhil Tripathi 13
Thank you shri and sai both are working fine. Efforts are appreciated.
Shri RajShri Raj
Please mark one as a best answer so that others can learn from the same issue if they face