I've been trying to implement a validation rule where a field contains certain characters to apply a validation rule for different roles like below:
AND
(
CONTAINS( CL_Pricing_model_name__c , "promo"),
OR(
CM_User__r.UserRole.Name = "Phone sales" && Stage_1_Minimum_Number__c < 10,
(CM_User__r.UserRole.Name = "Field sales" && Stage_1_Minimum_Number__c < CL_Pricing_model__r.Stage_1_Minimum_Number__c)
))
What I want to achieve:
If Pricing model name contains "promo", and UserRole name is Phone sales where Stage_1_Minimum_Number__c < 10, then throw an error
OR If Pricing model name contains "promo", and UserRole name is Field sales where Stage_1_Minimum_Number__c < 25, then throw an error
My validation rule works if I remove (CONTAINS( CL_Pricing_model_name__c , "promo"), but I need the rule only fire if the 1st part of the criteria is met, can someone please help me with my rule? What have I done wrong?
Thanks
2 件の回答
give it a try
AND
(
CONTAINS( CL_Pricing_model_name__c , "promo"),
OR(
(CM_User__r.UserRole.Name = "Phone sales" && Stage_1_Minimum_Number__c < 10),
(CM_User__r.UserRole.Name = "Field sales" && Stage_1_Minimum_Number__c < 25)
))