I have a business scenario where I would like to restrict the transition to the Accepted
status of the Quote object, only to the admin.
For this I configured a validation rule with the following error condition formula:
AND(
NOT($Profile.Name == 'System Administrator'),
ISCHANGED(Status),
TEXT(Status) = "Accepted"
)
The problem is that this rule is preventing all types of users(admin and non-admin ones) from transitioning to the Accepted
status.
In a bunch of other threads I have checked that this is actually considered an accurate approach.
Notes
I know that out there exist other approaches that are considered more efficient and consistent, like i.e. using a permission set, and referring to it, and not hardcoding the profile name in the rule, or even using custom settings.
In this case I am interested why Salesforce can detect this simple token through the $Profile.Name
field.
NOT($Profile.Name == 'System Administrator')
orTEXT(Status) = "Accepted"
?$Profile.Name != 'System Administrator'
Systemadministrator
. Very weird because when I query all the profiles in an anonymous context, I see that the name of the admin profile isSystem Administrator
indeed. Is there any hidden field like aDeveloperName
field or something that holds this info?