locked
OwnerId for account import RRS feed

  • Question

  • I am importing a bunch of accounts from a csv file using ImportFile and ImportMaps on the CrmService. I have created mappings for a number of fields, including the OwnerId field which is populated with SystemUserId (for users already existing in the system).  When I run the import, all the accounts are getting imported but OwnerId for each of the records is being set to just one user whose logon information I am using to connect to the service.

    I made sure that all the systemuserids exist in the system. I am not sure what could be going wrong here.

    I tried the CreateRequest API for one record at a time and it inserted OwnerId just fine. For some reason only the ImportFile API is having issue with the OwnerId insert. Since I need to import a large amount of data, I cannot rely on calling service with CreateRequest for each of the records. Any suggestions ?

    Best,

    Matt

    • Edited by TedMatt Friday, February 11, 2011 6:08 AM Added more information about single record import
    Friday, February 11, 2011 5:18 AM

Answers

  • Hi Matt,

    You cannot assign records during the data import. The trick that we used was:

    • Create additional N:1 relationship between account and systemuser which will give you a new lookup attribute for account entity
    • Create oncreate workflow for accounts that assign value to the user based on the value of that lookup attribute
    • Map the ownerid column in your csv to the new lookup
    • Import records
    • Depending on number of records and your server load you may have a time to make a cup of tea
    • Done
    • [Optional] Ditch the relationship
    Cheers
    --


    George Doubinski, MVP http://crm.georged.id.au
    • Proposed as answer by Amarsen Vangoor Friday, February 11, 2011 12:10 PM
    • Marked as answer by Jim Glass Jr Monday, February 14, 2011 5:46 PM
    Friday, February 11, 2011 10:56 AM
    Moderator

All replies

  • Hello TedMatt,

     

    Try inserting your data programmatically, using the CRM SDK.


    Cornel Croitoriu - Senior Software Developer - www.Biz-Forward.com
    Friday, February 11, 2011 7:32 AM
  • Hi,

    Please try with Data Migration Manager, if you have problem with using API. Import wizard imports data for the user who is performing the import.

    Else try to import the data from csv and have some mechanism to change owner afterwards.

    Regards,

    Soumya.


    soumya
    • Proposed as answer by Faisal Fiaz Friday, February 11, 2011 10:22 AM
    Friday, February 11, 2011 9:17 AM
  • Hi Matt,

    You cannot assign records during the data import. The trick that we used was:

    • Create additional N:1 relationship between account and systemuser which will give you a new lookup attribute for account entity
    • Create oncreate workflow for accounts that assign value to the user based on the value of that lookup attribute
    • Map the ownerid column in your csv to the new lookup
    • Import records
    • Depending on number of records and your server load you may have a time to make a cup of tea
    • Done
    • [Optional] Ditch the relationship
    Cheers
    --


    George Doubinski, MVP http://crm.georged.id.au
    • Proposed as answer by Amarsen Vangoor Friday, February 11, 2011 12:10 PM
    • Marked as answer by Jim Glass Jr Monday, February 14, 2011 5:46 PM
    Friday, February 11, 2011 10:56 AM
    Moderator
  • Hi Cornel,

    I am using the SDK. ImportFile and Import are SDK APIs.

    Thanks,

    Matt

    Friday, February 11, 2011 4:28 PM
  • You cannot vote on your own post
    0

    Hello George,

    Thanks for sharing the trick. This looks like a solution. But, I am still a bit confused by the fact that CreateRequest API works just fine and assigns the record. Only the Import APIs have issue with assigning. I am creating an import interface for my customer with expectation that the same interface could be used for the custom entities too. Before I proceed with solution, I would like to make sure that there is no way to use the Import APIs from sdk and assign the owners in one call. Another solution that I have is to use CreateRequest for each of the records, but this entails a trip to the server for each of the records.

    Thanks

    Friday, February 11, 2011 4:40 PM