Hello Salesforce Thinkers, In our previous blog we learned about
Organizations Admins Can Login as Any User in this blog we are going to learn How to Relate a Contact to Multiple Accounts in Salesforce.
It is possible that people often work with more than one company , a business owner might own more than one company.
In Salesforce we can easily track relationships between people and the companies with the help of a feature called Contacts to Multiple Account.
Contacts to Multiple Accounts lets us relate a contact to more than one account so we can track the relationships between people and the companies they work with without creating duplicate records.

When you use Contacts to Multiple Accounts, each contact needs to be associated with a primary account. This is the account that appears in Account Name and is usually the company the contact is most closely associated with.
we can easily see who have an indirect relationship or direct relationship with the account.
Direct relationship :- The relationship between a Contact and it’s primary account is a direct relationship.
Indirect relationship :- Any other accounts associated with the contact represent indirect relationships.

Enable Contacts to multiple Account:-
Go to Setup Enter “Account Settings” in quick find box.
Click on it.

Check the checkbox beside “Allow users to relate a contact to multiple accounts”.
Click on Save.
After enabling we have two options as shown in below image, that dictate what happens when a user tries to delete an account that has direct contacts that are related to other accounts , as well as what happens when a contact’s primary account gets replaced.

Adding a Related List to Accounts:-
In Lightning
Object Manager >> Account >> Page Layouts and select the layout you wish to modify.
First we add the Related List called “Related Contacts” to our Account page layout.

In the Related Contacts list we have a New Contact, Add Relationship Buttons similar to the standard Contacts Related List this is because Related Contacts also contains all of your direct Contacts for an Account, so you no longer need the standard Contacts Related List.
Related Contacts will also contain all of the relationship roles of other Contacts, so if you use the Contact Roles Related List, you can remove it from the page layout as well.
Adding a Related List to Contacts:-
Object Manager >> Contact>> Page Layouts
Now we add the Related List called “Related Accounts” to our Contacts page layout.

Now that everything is in place to link Contact to multiple Accounts. We can link Contact to other Accounts and define the relationship, or Role, that they have with the secondary Account.
To do this, simply locate the Account, scroll down to the new Related Contacts listing and click on the “Add Relationship” button.

On the next screen, select the Contact that you wish to associate with this Account and their Role, and then click on Save.

If you want to prevent activities from automatically rolling up to a contact’s primary account.
in Setup, go to Activity Settings and deselect “Roll up activities to a contact’s primary account“.

Thank you for reading this blog. Hope it is helpful.