1

I have 40k records that has parent Account field. I tried to export and Import using data loader , however I got Invalid Cross reference ID. So I have removed all the field that referencing the ID's , Now If iam inserting the records without the parent account I will loose all these record which one is related to which Parent.

Is there a Solution for this.

4
  • is this a data dump form another org that you are trying to load into your org? I ask you this because, Id's are different across orgs. You will have to load the parent account first then export the newly loaded parent account Ids and associate to the child record and then load the data back into the new org
    – Rao
    Commented Sep 28, 2016 at 16:58
  • @Rao yes it is from my Salesforce production org to Sandbox org Commented Sep 28, 2016 at 16:59
  • OK then your first step would be to export just the parent accounts from your sandbox, load into your production instance, Then export the loaded parent account and associate it back to the child accounts using vlookup on name / external ID or some unique identifier from your original list that you extracted. Look at this post for clear instruction on how to load parent child relationships:success.salesforce.com/answers?id=9063000000048VdAAI Look at this video : youtube.com/watch?v=88xb62VwQaU
    – Rao
    Commented Sep 28, 2016 at 17:09
  • Depending on your sandbox type there may be some limits on total records in each object as well as overall data size, however I can't find a link in the documentation to confirm it. See developer.salesforce.com/forums/?id=906F0000000BXSFIA4
    – Dave Humm
    Commented Sep 28, 2016 at 17:34

1 Answer 1

3

Ideally you would have an External Id that you could use for the mapping instead of the Salesforce Id. If so you should just be able to use the dataloader by using the External Id.

The Salesforce Id will be different across Orgs. Because of this the Id values in your current export will not exist in your Sandbox. What you will need to do is:

  1. Import all your Parent records (maintaining the old sf Id - or some other identifier)
  2. Export your parent records from sandbox (this will get you the new Ids)
  3. Cross reference the new export with the old using the identifier. (This could be a lookup in excel or do some sort of data scripting)
  4. In your child import file replace the Parent Id with the Cross reference Id from the new data set.

I usually write script that will do the data lookup and replace for me. Without an external id you will need to do some data processing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .