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
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 :-/Steve :-/

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 :-/Steve :-/

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!