Use Case: Update All Related Contacts (Account Contact Relationship)

Do you have the Account Contact Relationship enabled for your org? Similar to the Email Message Relation, the Account Contact Relationship is like a junction object between Account and Contact. It enables the creation of many-to-many relationships. You no longer need to create duplicated contacts if they are linked to several accounts. Note that I said LIKE a junction object because it works the same but only has lookup instead of master-detail relationships. Today let’s dive into how to handle this object in Flow!

Account Contact Relationship Data Structure

(See fields explanation of Account Contact Relationship)

* Big thanks to Brenda Buckner for sending in the case!

Lulu Mobile uses the standard Account object to track billing entities and the Contact object to track each sim card user. When there is a family package, each family member will be a separate contact. However, everyone will be under the same account using the Account Contact Relationship object. There is only one primary contact who is responsible for paying (poor guy), so this is the only person that the support will talk to. In each conversation, the support will then open this primary contact record and confirm all the information is up-to-date. If they update any of the fields, they want the system to automatically update all contacts under the same account.

(Assumption: One person will only be the primary contact of one account)

After understanding the data structure of the Account Contact Relationship, this will be a fairly easy flow to set up. We will use a Record-Triggered Flow to build the solution.

Flow Chart (Account Contact Relationship)

Update contacts using Account Contact Relationship
Steps (Account Contact Relationship)

Result (Account Contact Relationship)

Record-TriggeredGet RecordsVariable / Collection
LoopUpdate RecordsAssignment

Does the solution solve your problem? If not, write us what your problem is and we will build the flow for you!

Official Salesforce Help Article On Flow

Subscribe
Notify of
guest

24 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Jaime

Nice one! Im working on a similar solution. When a non related contact is added on an opportunity contact role of an account, this non related contact gets also attached of the related contact list of the account9

Morey Jones

This is really helpful! I was able to get my loop to work properly, but for some reason one of the records in the collection is not being updated. i.e. 6 of the 7 records are being updated properly. Have you experienced this issue before?

abhiram

Excellent Article, Is it possible to Track Employee History in a separate tab under the Contact related list “Employee History”. I want to define Employee(Contact) & Employee(Account) relationship using the Account Contact Relationship. I have enabled the Account Contact relationship. Can you help with the flow to achieve this requirement?

Thanks in advance!

Sam

I’m currently working on the Customer Community Portal for my org (we use Customer Community Plus License). 
 
Use case: One account and related contact manages 3-4 other accounts/contacts.
 
Manager account ABC Capital manages the investments of 
Account 1, Account 2, Account 3. ABC capital is parent account to these other accounts in the internal Account Hierarchy. OWD is currently set to private. Each account related contact will have the ability to log into the Community and view their own account records and other related records.
 
But when logged into the Community, I would like for the related contact of ABC Capital to be able to view the account/contact records for the accounts below him/her in the hierarchy. I do not want the users associated w/ Account 1, 2, or 3 to see each other’s records. 
 

Sandra Hegler

I have a slightly similar use case. I need a record-triggered flow that will start when the Roles field on the account contact relationship object is changed, but it should only update the related contact if the Direct checkbox is true. I created a custom field on the Contact object called ACR Roles. That field should match what is in the Roles field on the direct ACR object even if it is blank. Can you help? Thanks!

Last edited 2 years ago by Sandra Hegler
Derek

Is it possible to do the reverse, in which a change to data on the contact triggers an update to all of it’s related accounts? For example, if I change a custom field on John Doe, the flow updates a custom field on all of his related accounts?

Derek

That’s so cool! Thank you so much! I will give it a try.

Bivush

Hi! i have a business requirement where: I have Roles (billing, buyer) in the account contact relationship and the IsPrimary checkbox there. On the account i have Billing contact and shipping contact lookup fields.

what i want to do is. anytime the role in the account contact obj. is changed and made primary, this should override the exisiting BillTO and ShipTo contact on the account with the primary one.

Shalom

I want to count the number of related accounts associated with a contact i.e create a rollup summary with flow. How will you build this?

Umair Mohammad

Question, can you please use this certain use-case and formulate the Clear Problem Statement as you have illustrated in one of your earlier videos? I have included a snapshot for your reference. To be honest, I am confused.

Umair

Flow Problem Statement.png
Anissa

is it possible to use this to create new records?

Jonathan

Curious to know how you would apply similar logic using the Flow Components extension from app exchange that filters a collection based upon given criteria. https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FvN3wUAF

Jonathan

So I could use the IN operator to filter out a group of records that (for my use case) are account contact relationships which are child records of account. The tricky thing here is I don’t know how to filter them out. Since the list I’m getting is pulling based upon person accounts that has the main account in a custom field. The idea is to create new ACRs. Person accounts when initially created don’t have that relationship but the ones that are already there I was thinking grab all of them (child records of the main entity account) at once with one collection then filter out the ACRs somehow which is tricky since it’s on a different object yet all have the main entity account type in common.

Thanks for your help!

Last edited 2 years ago by Jonathan
prasanth

is it possible if account is inactive and need to check is it a direct contact to the account in accountcontact relationship object and need to upadte the contact as inactive(if contacts are morethan 100)

Eric Pohlabel

Im trying to do something similar with no luck AND I cant even seem to identify a record to debug with. Here goes:

I am trying to update AccountContactRelationship records when an AccountAccountRelationship record changes. Specifically, when the isActive checkbox changes. Right now I have a record triggered flow that runs whenever an AccountContactRelationship is updated and the isActive checkbox is changed from TRUE to FALSE. The flow then goes out and finds all the other AccountContactRelationship records where the Contact on the triggering record is also the Contact. Then, I loop through all of those AccountContactRelationship records and set the isActive checkbox on those records to FALSE. At least, thats the idea. It doesnt seem to work and I can’t even debug because I cant specify an AccountContactRelationship to use for the debug run. I try searching by the Contact and i just get a list of ALL the AccountContactRelationship relationship records and I have like over 250K of them. I also cant just find an AccountContactRelationship record by name, because there doesn’t seem to be a record name and the debug tool doesn’t recognize the recordId when I try to use that. HELP!