0

I have an error creating Validation Rule and is strange. Here is the VR:

AND(!$Setup.Bypass__c.ValidationRule__c,
!$Permission.IntegrationPermissions,
$User.Name != $Label.USER_MANAGER,
NOT(ISPICKVAL(Status__c, "Active")))

And... when I check the syntax, I have this response:

Error: Field Name does not exist. Check spelling.

But User has Name field, obviously. So I think I cannot access this field on VR.

Do you know if it is possible?

2
  • Does the error goes away if you remove $User.Name != $Label.USER_MANAGER, from formula? Otherwise try removing each condition one by one until you know the exact cause.
    – Raul
    Commented Mar 22, 2021 at 11:06
  • In fact, if I put $User.Username != $Label.USER_MANAGER, it works. But in this case, I would like to control the flow through Name instead Username.
    – CPS
    Commented Mar 22, 2021 at 11:10

1 Answer 1

2

Maybe you can use the concatenation of FirstName and LastName fields, no idea why Name is not available

($User.FirstName & ' ' &  $User.LastName) != $Label.USER_MANAGER

But I would recommend you to use a Field to hold if a user is a manager

1
  • Okay, is not exactly that I wanted to, but is a nice alternative. Thank you!
    – CPS
    Commented Mar 22, 2021 at 11:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .