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 

Validation Rule Help Contains

Criteria: User should not be able to change the stage of an oppty to anything but unqualified except if these conditions are true.

Division does not contain sales or finance
lead score > 0
type = renewal
total = 0.00

I have it working, but now I need to add the following to not include in the validation:
If the division contains sales and total  <= 10000

I'm not sure how to add that portion, since the current is looking for not contains 'Sales'
AND( 
NOT(ISPICKVAL(StageName,"Unqualified")), 
ISCHANGED(StageName), 
NOT( 
OR( 
CONTAINS(Division__c,"Sales"), 
CONTAINS(Division__c,"Finance"), 
Score__c > 0, 
ISPICKVAL(Type__c,"Renewal"), 
Total__c = 0.00)))

 
Best Answer chosen by Skeeter
Sanjay Mulagada 11Sanjay Mulagada 11
Sorry, try this it should work -

OR(
AND(
  NOT(ISPICKVAL(StageName,"Unqualified")),
  ISCHANGED(StageName),
   NOT(
    OR(
    CONTAINS(Division__c,"Sales"),
    CONTAINS(Division__c,"Finance"),
    Score__c > 0,
    ISPICKVAL(Type__c,"Renewal"),
    Total__c = 0.00)
     )
 ),
AND(
  NOT(ISPICKVAL(StageName,"Unqualified")),
  ISCHANGED(StageName),
  CONTAINS(Division__c,"Sales"),
  Total__c <= 10000
  )
)

All Answers

Sanjay Mulagada 11Sanjay Mulagada 11
Hello Skeeter, this should help you -

AND(
  NOT(ISPICKVAL(StageName,"Unqualified")),
  ISCHANGED(StageName),
   NOT(
    OR(
    CONTAINS(Division__c,"Sales"),
    CONTAINS(Division__c,"Finance"),
    Score__c > 0,
    ISPICKVAL(Type__c,"Renewal"),
    Total__c = 0.00),
AND(CONTAINS(Division__c,"Sales"),
  Total__c <= 10000)
  )
)
SkeeterSkeeter
Thank you, but it didn't work.  When I entered a different division, it allowed me to change the stage when it shouldn't have.
Sanjay Mulagada 11Sanjay Mulagada 11
Sorry, try this it should work -

OR(
AND(
  NOT(ISPICKVAL(StageName,"Unqualified")),
  ISCHANGED(StageName),
   NOT(
    OR(
    CONTAINS(Division__c,"Sales"),
    CONTAINS(Division__c,"Finance"),
    Score__c > 0,
    ISPICKVAL(Type__c,"Renewal"),
    Total__c = 0.00)
     )
 ),
AND(
  NOT(ISPICKVAL(StageName,"Unqualified")),
  ISCHANGED(StageName),
  CONTAINS(Division__c,"Sales"),
  Total__c <= 10000
  )
)
This was selected as the best answer
Sanjay Mulagada 11Sanjay Mulagada 11
Did that help you ?
SkeeterSkeeter
I believe that did the trick.  Thank you!