I'm trying to upload records using the data loader. The object I'm loading into has a master-detail relationship, but in the CSV, I don't set any external id or Salesforce id that identifies the master record I'm trying to link to.

Instead, I'm passing in a column the value of a field that exists in another object indirectly related. So with that value, I query for the actual record (in the before insert trigger) that I have to link in the mentioned master-detail relationship field. The problem is that the needed record sometimes doesn't exist, and with only one master that cannot be found, my whole batch of records fails, and the error CSV file that Data Loader outputs marks all rows of the CSV with the same error.

The main problem with this is that I cannot identify exactly which records are the ones to blame, which is highly problematic when you try to load tens of thousands of records.

Why can't Data Loader insert the records whose relationship has been populated and how can I at least know which are the real faulty ones?

  • 2
    It sounds like you're doing things the Complicated Way. Why don't you just use an External ID and let the database figure it out?
    – sfdcfox
    Commented May 3, 2017 at 17:41
  • I'm dealing with a model that could be infinite times better but changing it now is not an option Commented May 10, 2017 at 14:17
  • You can try by reducing your batchsize and try again. Usually the data loader will skip only the faulty records and shall process the other records in the batch.
    – Raghu
    Commented Jun 21, 2017 at 15:11


You must log in to answer this question.

Browse other questions tagged .