You need to sign in to do that
Don't have an account?

Validation rule - two conditions at the same time
Hello, I have created a validation rule which stop users linking one company's contacts to another company's account licence. However one record type 'IPAD Contact Licence' is excluded from this rule, all works fine and the formula currently looks like this:
AND(
Contact__r.AccountId <> Company_Licence__r.Company__r.Id,
RecordType.Name <> "IPAD Contact Licence"
)
Now I have a challenge to include this record type in this restriction but not fully - the Contact Account ID doesn't have to be equal to the Company Licence Company ID, but needs to be within the company hierarchy so our users can attach a contact to a licence sitting under a different branch.
I'm not sure how to amend the formula to ensure all the other record types follow the existing validation rule and add the exception above.
Hopefully this makes sense.
Thanks.
Katerina
AND(
Contact__r.AccountId <> Company_Licence__r.Company__r.Id,
RecordType.Name <> "IPAD Contact Licence"
)
Now I have a challenge to include this record type in this restriction but not fully - the Contact Account ID doesn't have to be equal to the Company Licence Company ID, but needs to be within the company hierarchy so our users can attach a contact to a licence sitting under a different branch.
I'm not sure how to amend the formula to ensure all the other record types follow the existing validation rule and add the exception above.
Hopefully this makes sense.
Thanks.
Katerina
The below handles pulling the ultimate parent 5 levels deep into the hierarchy.
So if the above formula field is called Ultimate_Parent__c then you can modify your validation rule to look similiar to the below example.