I'm having some issues with the following validation rule:
AND(
OR(
ISCHANGED(Sales_Rep__c),
ISCHANGED(Secondary_Rep__c)
),
$User.Id<>"005A0000005sOAv", /*User1 */
$User.Id<>"005A0000007TTqR" /*User2 */
)
The intended function is that it is supposed to restrict the editing of either sales rep field, unless you're one of the 2 listed users trying to edit it. If you are one of these two, editing of the field is allowed.
Initial error resolved, was comma.
Issue to be resolved: Is there a way to reference a user in a validation rule other than by their ID? In Apex I know I can query. How should I go about not hard-coding in a validation rule?
$User.Id<>"005A0000007TTqR", /*User2 */
. Also, hardcoding Ids is not recommended