AND(
ISPICKVAL(Status__c, "Approved"),
NOT(ISBLANK(Contact)),
NOT(INCLUDES(Contact.Status__c, "In Progress"))
)
I'm getting error
Error: Field Contact does not exist. Check spelling.
your problems comes from the fact that you are not taking your object hierarchy the right way.
What i mean is that one account has many contacts. As you are on the parent side of the relationship you cannot say contact.status
as they may be many contacts.
The dot notation is when you are on the child side of the relation and that you are going upwards to the parent. Indeed a contact has only ONE parent account thus you can say yourContact.Account.Name
while the other way around would return many contact (yourAccount.contacts
) and then for each of the contact you need to perform the check.
In order to make a validation for this usecase you need to create a flow that does the check or make an Apex validation that has an addError()
in the before trigger context.