Picture this: you’re building out a data model where you need to link a Contact to multiple Accounts. Maybe Contacts have relationships with a variety of companies that you need to track. Maybe you want to track not just employment affiliations, but volunteer organizations and clubs as well. Or you may want to track employment history by linking a Contact record to former employers in addition to their current position.
Several options are available to track these relationships, each with its pros and cons. In this post, we’re going to introduce each method and discuss their advantages and limitations so you can choose the best option for your org.
The options for linking a Contact to multiple Account Records are:
- Using the native Contact Roles table within Salesforce
- Enabling “Multiple Accounts to Contact” within your org to make use of the Contact Account Relationship object
- Building out a Custom Junction object
Account Contact Roles
First, we need to highlight one major caveat if you want to use Contact Roles to link Accounts and Contacts:
Contact Roles for Accounts are only available in Salesforce Classic.
Apart from the difference between Classic and Lightning, Account Contact Roles are the most straightforward to set up as they are part of the platform by default. Only minimal additional configuration is needed. The only additional step that needs to be taken after spinning up a new org is to add the “Contact Roles” related list to the Account and Contact page layouts. From there, new Account-Contact relationships can be defined from either related record.
There are a couple of things to keep in mind should you take this route:
- User Permission and Sharing Access restrictions still apply
- With Contact Roles, when you add an Account record to an Opportunity, all contacts that are related to that account are added into the Opportunity Contact Role table for that Opportunity as well.
- Using Person Accounts with this functionality is not recommended – Partners would be a better fit for linking person accounts to other accounts.
Multiple Accounts to Contact
The second option is a Salesforce setting that allows multiple Accounts to be linked to a Contact record. This works similarly to the Account Contact Role described above but with a few notable differences:
- Multiple Accounts to Contact is available for use in Lightning Experience
- In order to add a second account to a contact, the Primary Account lookup field must be populated
- More customization options are available on the Account Contact Relationship object, including modifying the role picklist and a limited subset of available custom field types
However, there are some limitations and quirks to consider before committing to using the Multiple Accounts to Contact functionality in your org.
Several features reference only the Primary Account contact. It either isn’t possible to reference any indirect/secondary account relationships (eg: in formulas) or only the primary account is taken into consideration (eg: Duplication checks)
The following Custom Field types are not available:
- Lookup Relationship
- Master-Detail Relationship
- Roll-up Summary
- Text Area (Long)
- Rich Text Area
Likewise, the following customization options are not supported:
- Field History
- Field Sets
- Record Types
- Field Label Renaming
Multiple accounts to contact would be effective for cases where you’re not looking for a ton of customization, history tracking, or linking the relationship object to other standard or custom objects. As an example, you could be looking to link contacts to not only their employers, but organizations for whom they volunteer, or clubs where they hold a membership.
Building a Custom Junction Object
The third and final option has the highest customization options and the most development overhead: Creating your own custom junction object.
A junction object is used when you need to define a many-to-many relationship between two database tables. In this case, a contact can be associated with multiple accounts, and an account can have multiple contacts associated with it. Both previous methods we discussed in this article are also technically junction objects, but with certain limitations in place.
While custom junction objects offer the greatest flexibility in terms of fields, sharing and configuration, all of these need to be set up manually. This includes any Report Types, interactions with other objects, UX, app integrations and so on.
There are many use cases for linking a Contact record with multiple Accounts. Salesforce provides out-of-the-box options and a robust platform for designing a custom solution to fit your particular use case. Each of these three options fits a particular niche and can be suitable for one or more situations. Armed with the list of pros and cons of the different approaches, the administrator and system architect can feel empowered to select the best solution available for any project.
Are you working on configuring your data model within Salesforce and just want to through some basics with someone who knows the ropes? Get in touch! We’d love to hear from you.