Ask Search:
Jabari JacksonJabari Jackson 

Linking Custom Object Record to Account Based on Matching Field

I have a custom object that i'm populating with data. The custom object and the Account object have a common EIN number field. I'd like to create a process that checks the system for the Account with the matching EIN number and then populates the Organization Link field (show in the picture) with the matching Account ID. Whats the best way to accomplish this? Thanks!User-added image
Best Answer chosen by Jabari Jackson
Kyle MoseleyKyle Moseley
Hi Jabari,

You have two options, you could do this with a Apex Trigger to query to an account that uses that same field or

You would create a process builder that calls a visual flow. Steps for this would be:

1. Create a Process Builder on your "IRS Data" object for when the record is created. 
2. Criteria would be that EIN number (ISNULL) = FALSE.
3. Call a visual flow passing in the Record ID and the EIN number as variables.
4. First step in the visual flow would be to lookup Accounts using the EIN number as the search criteria.
5. Store the found Account ID in a variable (acctid) or whatever you would like to call it. 
6. Create an Update Element updating the IRS Data record based on the record ID you passed in with the Account ID variable that you found in the Lookup Account Step.

Let me know if you have any additional questions and if the best solves your question, please remember to mark as "Best Answer"

Thank you. 

All Answers

Kyle MoseleyKyle Moseley
Hi Jabari,

You have two options, you could do this with a Apex Trigger to query to an account that uses that same field or

You would create a process builder that calls a visual flow. Steps for this would be:

1. Create a Process Builder on your "IRS Data" object for when the record is created. 
2. Criteria would be that EIN number (ISNULL) = FALSE.
3. Call a visual flow passing in the Record ID and the EIN number as variables.
4. First step in the visual flow would be to lookup Accounts using the EIN number as the search criteria.
5. Store the found Account ID in a variable (acctid) or whatever you would like to call it. 
6. Create an Update Element updating the IRS Data record based on the record ID you passed in with the Account ID variable that you found in the Lookup Account Step.

Let me know if you have any additional questions and if the best solves your question, please remember to mark as "Best Answer"

Thank you. 
This was selected as the best answer
Jabari JacksonJabari Jackson
Hey Kyle, 

Thanks so much for your quick response! Your steps for creating the visual flow makers sense. I'm going to put this together and test. Thanks again!