locked
Import Contacts and associate with Accounts in Dynamics CRM 2013 RRS feed

  • Question

  • Using Dynamics CRM 2013 on-premise version.  Brand new install, never used Dynamics before.

    Using the supplied XML import templates, I am able to import Accounts and Contacts but can't seem to link them such that when you view an Account you see a list of contacts, or when you view a contact it has the associated company name.

    I've tried mapping this literally at least 20 different ways, using a zip file to import both accounts and contacts in one file or uploading them separately.  Pretty simple field set up in my source files, which are from the import templates but with a few extra fields at the end, like Company ID:

    Accounts: Company ID, Company Name, Phone, etc.
    Contacts: First Name, Last Name, Company ID, etc., where Company ID is a foreign key for the field in Accounts

    Let's assume I've successfully imported Accounts where the field Account Number was mapped to my Company ID, so now I want to import/associate Contacts.  This is what I put in the field mapping wizard:

    Company ID (Source) = A lookup field called "Account Number", related record type is Account, referred field is "Account Number"

    Company Name (Source) is empty, but the default map = A lookup field called "Company Name", related record types are both Account and Contact, with referred fields being "Account (Primary Key); Account Name" and "Contact (Primary Key); Full Name" respectively.

    Contacts are imported, but not associated, as mentioned above. 

    Help?



    Friday, March 14, 2014 7:12 PM

Answers

  • Hi,

    It sounds like you are almost there and certainly are getting to grips with import wizard!

    I suspect that the bit you are missing is that you need to map a column to the 'Parent Customer' field on the Contact and have this look up against the accounts. 

    Here is a full description of how to do this - http://blogs.msdn.com/b/dynamicscrmonline/archive/2011/06/24/crm-2011-data-import-wizard-importing-related-accounts-and-contacts.aspx

    Hope this helps,

    Scott


    Scott Durow
    Blog www.develop1.net    Follow Me
    Rockstar365
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Friday, March 14, 2014 7:31 PM
    Answerer
  • Hi,

    Oh yes, in CRM2013 it is called 'Company Name (lookup)' so your lookup would look something like:

    Hope this helps,

    Scott


    Scott Durow
    Blog www.develop1.net    Follow Me
    Rockstar365
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Friday, March 14, 2014 7:53 PM
    Answerer
  • For anyone else who might be struggling through this, I figured out a work-around.  First, see the link above from Scott to get the gist of it. 

    Basically what I've found is that to import Accounts and Contacts simultaneously via a zip file, the Account Name field in Accounts MUST BE unique.  It doesn't matter if in your data mappings your lookup field attempts to combine it with a unique field (like Account Number), it will simply fail every time Account Name has a duplicate.  Why MS chose to make this a highly exalted field is beyond me.  Why not Account Number??

    So what I did was append the Account Number (the primary key in my legacy system) to the Account Name field in Accounts, and do the same for the Company Name field in Contacts.  So instead of the Account Name being "Krusty Burger", it is "Krusty Burger #1234".  Also, the Company Name field in Contacts must match this value.  A normalized database would have just a Company ID in the Contacts table, but, again baffling to me, you must have the full name there.  So when querying my contacts table to export, I joined the companies table to get the full company name.

    If your data is set up that way, the default mapping for Company Name in the Contacts table will actually work.  So this would be the "Company Name (Lookup)" field:

    • Related Record: Account, Referred Field: Account (Primary Key); Account Name
    • Related Record: Contact, Referred Field: Contact (Primary Key); Full Name

    For some, appending to the Account Name value will not be an option so this won't work.  Sorry, but now you will at least know why it doesn't work.

    • Marked as answer by Steve-Ex Tuesday, March 25, 2014 2:33 PM
    Tuesday, March 25, 2014 2:32 PM

All replies

  • Hi,

    It sounds like you are almost there and certainly are getting to grips with import wizard!

    I suspect that the bit you are missing is that you need to map a column to the 'Parent Customer' field on the Contact and have this look up against the accounts. 

    Here is a full description of how to do this - http://blogs.msdn.com/b/dynamicscrmonline/archive/2011/06/24/crm-2011-data-import-wizard-importing-related-accounts-and-contacts.aspx

    Hope this helps,

    Scott


    Scott Durow
    Blog www.develop1.net    Follow Me
    Rockstar365
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Friday, March 14, 2014 7:31 PM
    Answerer
  • Thanks for the reply, Scott!  I'd actually seen that blog post, but in CRM 2013 there is no "Parent Customer" field in the mapping wizard, nor is the field in the import template.  :-(  I can create that field in the template so it appears on the Source Fields side of the mapping, but there is no corresponding field on the CRM Fields side.
    Friday, March 14, 2014 7:45 PM
  • Hi,

    Oh yes, in CRM2013 it is called 'Company Name (lookup)' so your lookup would look something like:

    Hope this helps,

    Scott


    Scott Durow
    Blog www.develop1.net    Follow Me
    Rockstar365
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Friday, March 14, 2014 7:53 PM
    Answerer
  • I appreciate the help, Scott, but I'm still not getting it.

    I'm back to trying to import both at the same time.  5 more import attempts later, the primary contact field is now populating for Accounts, but I still can't see a list of other contacts for that Account, or see the company name in a Contact.  My latest attempt looks like this, with fields not listed being left as default.

    1. Account
      1. Account Name = Account Name
      2. Account Number = Account Number
      3. Primary Contact:
        1. Primary Contact (Lookup)
        2. Related Record Type: Contact
        3. Referred Field = Legacy: Contact ID
      4. Legacy_LASTMODIFIER = New, Whole Number, “Legacy: Last Modifier”
      5. Legacy_SUBMITDATE = Created On
      6. Legacy_SUBMITTER = New, Whole Number, “Legacy: Submitter”
      7. Legacy_UUID = New, Single Line of Text, “Legacy: UUID”
    2. Contact
      1. Company Name:
        1. Company Name (Lookup)
        2. Related Record: Account
          1. Referred Field = Account (Primary Key); Account Number
        3. Related Record: Contact
          1. Referred Field = Contact (Primary Key); Legacy: Contact ID
      1. Legacy_COMPANYID = Ignore
      2. Legacy_CONTACTID = Legacy: Contact ID
      3. Legacy_LASTMODIFIEDDATE = Ignore
      4. Legacy_LASTMODIFIER = New, Whole Number, “Legacy: Last Modifier”
      5. Legacy_SECONDARY_EMAIL = Ignore
      6. Legacy_SUBMITDATE = Created On
      7. Legacy_SUBMITTER = New, Whole Number, “Legacy: Submitter”
      8. Legacy_USERID = New, Whole Number, “Legacy: User ID”
    3. Allow Duplicates

    If I ever get it figured out I will post the exact mapping required.  Only about a million more possibilities to go.

    Friday, March 14, 2014 9:38 PM
  • For anyone else who might be struggling through this, I figured out a work-around.  First, see the link above from Scott to get the gist of it. 

    Basically what I've found is that to import Accounts and Contacts simultaneously via a zip file, the Account Name field in Accounts MUST BE unique.  It doesn't matter if in your data mappings your lookup field attempts to combine it with a unique field (like Account Number), it will simply fail every time Account Name has a duplicate.  Why MS chose to make this a highly exalted field is beyond me.  Why not Account Number??

    So what I did was append the Account Number (the primary key in my legacy system) to the Account Name field in Accounts, and do the same for the Company Name field in Contacts.  So instead of the Account Name being "Krusty Burger", it is "Krusty Burger #1234".  Also, the Company Name field in Contacts must match this value.  A normalized database would have just a Company ID in the Contacts table, but, again baffling to me, you must have the full name there.  So when querying my contacts table to export, I joined the companies table to get the full company name.

    If your data is set up that way, the default mapping for Company Name in the Contacts table will actually work.  So this would be the "Company Name (Lookup)" field:

    • Related Record: Account, Referred Field: Account (Primary Key); Account Name
    • Related Record: Contact, Referred Field: Contact (Primary Key); Full Name

    For some, appending to the Account Name value will not be an option so this won't work.  Sorry, but now you will at least know why it doesn't work.

    • Marked as answer by Steve-Ex Tuesday, March 25, 2014 2:33 PM
    Tuesday, March 25, 2014 2:32 PM