0

I am having this issue with dataloader. I am doing an insert and I get an error:

 id value of incorrect type: ABCD

Where ABCD is my value. I have 2 custom objects and CustomObject2. CustomObject2 has a field which is a lookup relationship to CustomObject1. I have looked online and I know I need to pass the ID to this lookup field in my csv file. However since it is an insert I do not have the ID. How would I insert my value ("ABC") in this lookup field?

3
  • If you are trying to insert records and you have an Id column, simply do not map that column. What are you trying to achieve here? Why are you trying to insert records where you already have an Id value? Are you sure it's not supposed to be an External Id field?
    – Adrian Larson
    Feb 8, 2018 at 15:01
  • @AdrianLarson I have an auto number field but I do not map that to anything. I don't have an ID field in my csv file. I am trying to insert records into salesforce
    – M guy
    Feb 8, 2018 at 15:04
  • 1
    You're mapping something to an Id field and your question doesn't include enough detail to really offer a good answer without some guessing. Remove any field mappings for relationships in addition to making sure you don't map Id.
    – Adrian Larson
    Feb 8, 2018 at 15:06

1 Answer 1

2

So, to be able to link your Child object (custom object 2) to your Parent object (custom object 1) using the "ABCD" value and not the ID via dataloader you must :

  1. Create an external id field in the parent object, it's the field that stores your "ABCD" value on the parent.
  2. In dataloader, choose the upsert operation for the child object -> you will be asked to choose an external id field to match your child records with parent object records, choose the field you just created.
  3. Now, when mapping, you will find a special field called "Parent_object__r:external_id__c"
  4. In the mapping, leave the lookup field empty, and match your file column having the "ABCD" value with the special field "Parent_object__r:external_id__c"
  5. Salesforce will create your child record and automatically fills the lookup field based on the external id.

Doc : https://help.salesforce.com/articleView?id=000002783&r=https%3A%2F%2Fwww.google.fr%2F&type=1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.