+ Start a Discussion
janeisaacjaneisaac 

problem with an OR statement in a Validation Rule

I want to make it so that only users with one of three profiles can edit the Account Name if the record type is Customer.

 

I have it working for one profile but when I try to add an OR statement and include the two other profiles, it does not work:

 

Here is what is working now:

AND(
( $RecordType.Name  ="Customer"),
 ISCHANGED( Name ),
 $Profile.Name<>"System Administrator - Integration"
)

 

Here's what I tried:

AND(
( $RecordType.Name  ="Customer"),
 ISCHANGED( Name ),

OR(

$Profile.Name<>"System Administrator - Integration",

$Profile.Name<>"System Administrator - KM",
$Profile.Name<>"System Administrator - KMGP"

))

 

Can someone see what is wrong with the OR part of this formula?

 

Thank you so much!

Jane

Best Answer chosen by Admin (Salesforce Developers) 
Steve MolisSteve Molis

I think I might have it!

AND(
$RecordType.Name  = "Customer",
ISCHANGED(Name),
$Profile.Name <> "System Administrator - Integration",
$Profile.Name <> "System Administrator - KM",
$Profile.Name <> "System Administrator - KMGP")

 

All Answers

Steve MolisSteve Molis

I think I might have it!

AND(
$RecordType.Name  = "Customer",
ISCHANGED(Name),
$Profile.Name <> "System Administrator - Integration",
$Profile.Name <> "System Administrator - KM",
$Profile.Name <> "System Administrator - KMGP")

 

This was selected as the best answer
janeisaacjaneisaac

Yes my friend - that did it. I did not need the OR statements at all. Thanks for your help!