web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Import Account and related contact record into CRM using SSIS

(0) ShareShare
ReportReport
Posted on by 30

I am importing account record which have related company name also in it,and  related contact is not in the CRM. I am getting error while am importing account record.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    There are probably a few different ways to do this in SSIS, and each will probably work, but I will start with the questions.

    Where is your source data coming from?

    What do you mean by related company? Is that a Parent Company?

    Let's take a scenario that your Source is in SQL.

    I would make sure that I have a unique integer identity field for the source. The reason for this is that I can query the data back and get record Ids if necessary. I would also add columns called ContactId (uniqueidentifier), and ParentAccountId (uniqueidentifer) - If that is what you meant by related company. Think of it as a staging table.

    I am basing the following on using KingswaySoft SSIS tool. Each step below is basically a different Control Flow.

    Some of the steps below are optional, and I explain at the end in the Notes.

    Step 1 - Import All Contacts, and add the unique integer id that we created in the importsequencenumber field. You will need to apply different logic if you have multiple contact or duplicate contacts, by checking the contact exists based on a unique field such as email address.

    Step 2 (Optional) - Retrieve the Guids of all contacts and store them back to your source. Use the lookup control and query the FilteredContacts view in the CRM database to get the Ids. As mentioned in the previous step, this can be by importsequencenumber or email address (or another unique field).

    Step 3 - Import all the parent accounts (records that do not have related companies).

    Step 4 (Optional)- Retrieve the Guid of all parent accounts and store them back to the source. Use the lookup control and query the FilteredAccounts view in the CRM database to get the Ids. In this case this can be by importsequencenumber or account name.

    Step 5 - Import all the accounts that have a Guid for the related account. The ones that were not yet imported. Make sure that you enter the parent account id here.

    Step 6 (Optional) - Retrieve all the account Guid of the child accounts. Use the lookup control and query the FilteredAccounts view in the CRM database to get the Ids. In this case this can be by importsequencenumber or account name.

    Step 7 - Associate the parents with the children. Update the primary contact id field (primarycontactid) in the account entity.

    => This can also be done in the previous stages...

    Notes:

    --> If you have multiple depths of parent accounts, the logic will have to get modified, and Steps 3-6 will have to be run on each level of accounts.

    --> The retrieval methods are not required (optional), as you can do the match (lookup) within the import/creation process, but will just make it for an easy way to stage your data and check it before importing it in each stage.

    As mentioned, this is one way of implementing this. Although long, easy on complexity. There are shorter way to do this, but will be more complex.

    If your data source already has GUIDs for accounts and contacts, this can become much easier, as you will not have to retrieve those values back into your datasource.

    Not having seen your data, this is my recommendation. You might be able to get this to work with the Data Import wizard as well, which will do some matching. Maybe with 2 imports, but since you asked the SSIS route, this is not a bad way.

  • Suggested answer
    Priya1 Profile Picture
    30 on at

    Thanks Aric

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans