AND (
OR ( $Profile.Name <> "System Administrator", $Profile.Name <> " Integration User"),
OR (Status__r.Name ='Ready', Status__r.Name ='Sent' ),
PRIORVALUE (Ticket__c) > Ticket__c
)
3 answers
Use AND not OR
AND (
CASE( $Profile.Name ,
"System Administrator", 1,
"Integration User", 1,
0) = 0,
CASE(Status__r.Name ,
'Ready', 1,
'Sent', 1,
0 ) = 1,
PRIORVALUE (Ticket__c) > Ticket__c
)
You don't want to use an OR statement with NOT or <> like that. A field like $User.Id, $Profile.Id, $Profile.Name, etc. can only hold 1 value at a time.
Any User can only have 1 UserId, 1 Profile, 1 Role, etc
So for example if:
Moe has $Profile.Name = X
Larry has $Profile.Name = Y
Curly has $Profile.Name = Z
Joe has $Profile.Name = Q
And we want to block any other User with Profile <> X, Y, Z from doing something. If your Formula uses Logic like this:
OR(
$Profile.Name <> "X",
$Profile.Name <> "Y",
$Profile.Name <> "Z",
)
Joe is blocked because Q is <> X or Y or Z
great!
BUT...
Moe is also blocked because X is <> Y or Z
Larry is also blocked because Y is <> X or Z
Curly is also blocked because Z is <> X or Y
So now every User is blocked, not just the one's you want (and that's not so great)
Unless the User is Schrodinger's Cat, then all bets are off...