Combine three similar validation rules - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
B LeahyB Leahy 

Combine three similar validation rules

I have three separate validation rules that work well, but they are similar in function and I would prefer to have one Validation rule if possible.

The validation rules check if a correpsonding resource field (PM User, CEM User, TAM User) is blank before allowing a child record to be created that requests one be assigned to the account...

Rule 1 = PM is already assigned on Account
AND(
RecordType.DeveloperName="PM",
NOT(ISBLANK( Related_Opportunity_CAT__r.Account_PM_User__c))
)

Rule 2 =
AND(
RecordType.DeveloperName="CEM_Only",
NOT(ISBLANK( Related_Opportunity_CAT__r.Account_CEM_User__c))
)

Rule 3 =
AND(
RecordType.DeveloperName='CEM_TAM',
NOT(ISBLANK( Related_Opportunity_CAT__r.Account_Tam_User__c))
)

I was attempting a case solution, but it wasn't working. I appreciate any suggestions.
Thanks!
Best Answer chosen by B Leahy
Jayson MoralesJayson Morales
Hi B,

Did you try this:
 
OR(

AND(
RecordType.DeveloperName="PM",
NOT(ISBLANK( Related_Opportunity_CAT__r.Account_PM_User__c))
),

AND(
RecordType.DeveloperName="CEM_Only",
NOT(ISBLANK( Related_Opportunity_CAT__r.Account_CEM_User__c))
),

AND(
RecordType.DeveloperName='CEM_TAM',
NOT(ISBLANK( Related_Opportunity_CAT__r.Account_Tam_User__c))
)

)


Regards,
Jayson