You need to sign in to do that
Don't have an account?
sam_Admin
Priorvalue in Validation rule
Hi Folks,
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.
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.
And then you can VR formula can use this field like this: PRIORVALUE(Test__c) <> "TBD"
Hope that helps.
All Answers
However, I am not sure you can use PRIORVALUE for checking the owner's first name in this way.
AND(
OR($UserRole.Id = "00E30000000vEST",
$UserRole.Id = "00E40000001CZB5"),
ISCHANGED(OwnerId),
PRIORVALUE(OwnerId) <> "00540000001SyUq",
PRIORVALUE(OwnerId) <> "00540000001UnYg",
PRIORVALUE(OwnerId) <> "00540000002FltR",
PRIORVALUE(Owner.Test__c) <> "TBD"
)
Error: The PRIORVALUE function cannot reference the Owner.Test__c field.
Error: The PRIORVALUE function cannot reference the $User.Test__c field.
And then you can VR formula can use this field like this: PRIORVALUE(Test__c) <> "TBD"
Hope that helps.