You are here:
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.

Use more general search terms.
Select fewer filters to broaden your search.
You are here:
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.
| Available in: both Salesforce Classic and Lightning Experience |
| Available in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions |
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)
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.