Validation Rule Update: I don't want the existing rule to apply to one of our users - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Emily HolthausEmily Holthaus 

Validation Rule Update: I don't want the existing rule to apply to one of our users

Hi there,

I have the below validation rule active in our org. It works well, but I need to edit the rule so it won't apply to one single user. What do I need to add to the formula?

AND(RecordType.Name ="3rd Party",
ISPICKVAL(Opportunity_Business_Type__c , "New Business"),
OR( ISPICKVAL(StageName, "Activate & Transition"),
ISPICKVAL(StageName, "Retain & Grow")
),
OR(
ISPICKVAL(X3rd_Party_Pricing_Approval__c,''),
ISPICKVAL(X3rd_Party_Pricing_Approval__c, "Rejected")))


Thank you!

Emily
Best Answer chosen by Emily Holthaus
Steve MolisSteve Molis
AND(
$User.Username <> "user@your.org",
RecordType.Name ="3rd Party",
ISPICKVAL(Opportunity_Business_Type__c , "New Business"),
OR( 
ISPICKVAL(StageName, "Activate & Transition"),
ISPICKVAL(StageName, "Retain & Grow")
),
OR(
ISPICKVAL(X3rd_Party_Pricing_Approval__c,''),
ISPICKVAL(X3rd_Party_Pricing_Approval__c, "Rejected")
)
)

 

All Answers

Steve MolisSteve Molis
AND(
$User.Username <> "user@your.org",
RecordType.Name ="3rd Party",
ISPICKVAL(Opportunity_Business_Type__c , "New Business"),
OR( 
ISPICKVAL(StageName, "Activate & Transition"),
ISPICKVAL(StageName, "Retain & Grow")
),
OR(
ISPICKVAL(X3rd_Party_Pricing_Approval__c,''),
ISPICKVAL(X3rd_Party_Pricing_Approval__c, "Rejected")
)
)

 
This was selected as the best answer
Emily HolthausEmily Holthaus
Steve - thank you! Does "user" = the usual actual name spelled out or their user ID?
 
Emily HolthausEmily Holthaus
users*
Steve MolisSteve Molis
That would be their Username (what they use to login) not their User.Id 

User's can't edit their own Username (unless you've made like everyone a Sys Admin)  

 
Steve MolisSteve Molis
If you wanted to use their ID you'd use  

AND(
$User.Id <> "005001002003aBc",
RecordType.Name ="3rd Party",
ISPICKVAL(Opportunity_Business_Type__c , "New Business"),
OR( 
ISPICKVAL(StageName, "Activate & Transition"),
ISPICKVAL(StageName, "Retain & Grow")
),
OR(
ISPICKVAL(X3rd_Party_Pricing_Approval__c,''),
ISPICKVAL(X3rd_Party_Pricing_Approval__c, "Rejected")
)
)
Emily HolthausEmily Holthaus
Makes complete sense. Thank you again!
Steve MolisSteve Molis
No problem Emily, glad you got it sorted out (and thanks for the + Best Answer)

Cheers,

SteveMo