---
schema_version: "1"
id: 534dc2119997f7043a5429dc43efd0452ba569d392ce30cb6c28cb16fec9b496
title: Validation Rules for Account Contact Relationships
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/account_contact_relationship_and_validation_rules.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.account_contact_relationship_and_validation_rules.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 98a525e317b2104607ecece45497a00e2a5e7b1957156ac4c40042dfb62a8379
description: If your org uses Contacts to Multiple Accounts and you’ve created validation rules for the Account Contact Relationship object, you must bypass those validation rules in some cases.
products:
  - Sales Cloud
release: "264"
---
# Validation Rules for Account Contact Relationships

If your org uses Contacts to Multiple Accounts and you’ve created validation rules for the Account Contact Relationship object, you must bypass those validation rules in some cases.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Contact Manager</strong>, <strong>Group</strong>, <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

When a contact with a related account is created, a direct Account Contact Relationship record is also created. Similarly, when a contact gets a new primary account, the current direct Account Contact Relationship record is modified. Validation rules for the Account Contact Relationship are run immediately after the contact is saved to the database.

Because the Account Contact Relationship records are created behind the scenes and users can’t access the Account Contact Relationship fields when creating or editing a contact, validation rules can block the contact from being saved.

For example, the following Account Contact Relationship validation rule requires a value for the Roles field.

`ISNULL(Roles)`

However, a user can’t access the Roles field on the Account Contact Relationship object when creating or editing the contact. Therefore, the criteria in the validation rule can’t be met, and the contact can’t be saved.

To bypass the validation rule when a direct Account Contact Relationship is created, add the following syntax to your Account Contact Relationship validation rule.

`(NOT (ISNEW() && IsDirect)) && (NOT ISCHANGED(IsDirect))`

Now, the Account Contact Relationship validation rule states that the Roles field is required only if the Account Contact Relationship isn’t a direct relationship.

```
(NOT (ISNEW() && IsDirect)) && (NOT ISCHANGED(IsDirect))
&&
ISNULL(Roles)
```

#### See Also

- [Contacts to Multiple Accounts](https://help.salesforce.com/s/articleView?id=sales.shared_contacts_overview.htm&release=264.0.0&type=5 "People often work with more than one company. A business owner might own more than one company or a consultant might work on behalf of multiple organizations. Relate a single contact to multiple accounts so you can easily track the relationships between people and businesses without creating duplicate records.")
- [Set Up Contacts to Multiple Accounts](https://help.salesforce.com/s/articleView?id=sales.shared_contacts_set_up.htm&release=264.0.0&type=5 "Let your sales reps easily track the relationships between the customers and businesses they work with. Contacts to Multiple Accounts is quick to set up and allows reps to relate a single contact record to multiple accounts.")