Related to my previous question: How to make accounts read-only / locked?
I'm trying to prevent changes from being made to accounts with a certain record type.
One possible change a user could make is to the list of related objects (e.g. its contacts). Accordingly, I'm trying to write a validation rule for these object types that prevents them from being either added to or removed from these records. I thought the following would work:
AND(
OR(
Account.RecordTypeId = "0124E0000000fKD",
PRIORVALUE(Account.RecordTypeId) = "0124E0000000fKD"
),
OR(
ISCHANGED(AccountId),
ISNEW()
)
)
But a get a syntax error:
The PRIORVALUE function cannot reference the Account.RecordTypeId field
Some Googling reveals that others have had similar problems (e.g. this thread).
So: what's the right way to check the record type of the previously linked account?