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
SkeeterSkeeter 

Opportunity Validation Rule Help Not Contains

I'm trying to create a validation rule that will prevent a user from changing the stage of an opportunity to anything but 'Unqualified' unless one of the following criteria is true.
1. Division does not contain Payer, Marketing, HR
2. Score > 0
3. Business Type = Renewal
4. AOV = 0 or <= 20000

I thought I had it correct, but when I tested an oppty with the division of HR, score = 0 and AOV = 50k it passed and it shouldn't have.

Any help is appreciated.
 
AND(
NOT(ISPICKVAL(StageName,"Unqualified")),
ISCHANGED(StageName),
NOT(
OR(
CONTAINS(Division__c,"HR"),
CONTAINS(Division__c,"Payer"),
CONTAINS(Division__c,"Marketing"),
Score__c > 0,
ISPICKVAL(Business_Type__c,"Renewal"),
AOV__c <= 20000)))

 
DavidGantDavidGant
Skeeter - I believe the issue is that your NOT() is impacting the entire OR() and not just lines 6-8. Try putting the NOT() around each CONTAINS().
Arun KumarArun Kumar
HI,

Try below code:
AND(
NOT(ISPICKVAL(StageName,"Unqualified")),
ISCHANGED(StageName),
OR(
CONTAINS(Division__c,"HR"),
CONTAINS(Division__c,"Payer"),
CONTAINS(Division__c,"Marketing"),
NOT(
OR(
Score__c > 0,
ISPICKVAL(Business_Type__c,"Renewal"),
AOV__c <= 20000)
)

))

Please let me know if the helps.


As a common practice, if your question is answered, please choose 1 best answer.
Additionaly you can give every answer a thumb up if that answer is helpful to you.

Thanks,
Arun