[SalesForce] Priorvalue in Validation rule

Iam trying to simplify my validation rule but i get error. My VR restricts users from role from chaning ownerid for subset of users, since all my users first name is "TBD" i want to simpify the rule by adding owner.firstname, here is my rule

AND(
OR($UserRole.Id = "00E30000000vEST",
$UserRole.Id = "00E40000001CZB5"),
ISCHANGED(OwnerId),
PRIORVALUE(OwnerId) <> "00540000000zpgS",
PRIORVALUE(OwnerId) <> "00540000000oWNX",
PRIORVALUE(OwnerId) <> "00540000000lkIN",
PRIORVALUE(OwnerId) <> "00540000001SyUq",
PRIORVALUE(OwnerId) <> "00540000001UnYg",
PRIORVALUE(OwnerId) <> "00540000002FltR",
PRIORVALUE(OwnerId) <> "00540000002nKbr",
PRIORVALUE(OwnerId) <> "00540000002JAiR",
PRIORVALUE(OwnerId) <> "00540000002IeDq",
PRIORVALUE(OwnerId) <> "00540000002nU49",
PRIORVALUE(OwnerId) <> "00540000002nU4Y",
PRIORVALUE(OwnerId) <> "00540000002nU4T"
)

I want to use PRIORVALUE(Owner.FirstName <> "TBD") but i get this error "Incorrect argument type for function 'PRIORVALUE()'."

Any help is appreciated.

Best Answer

Unfortunately, you can't reference the field directly, so you have to use a formula:

Field Name: Owner_First_Name__c
Return Type: Text
Formula: Owner.FirstName

Then, you can reference it as such:

PRIORVALUE(Owner_First_Name__c) = 'TBD'
Related Topic