function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Apex dataloader - importing csv to object with master-detail field

When importing records to a master-detail field it seems salesforce requires it be in the form of an id ('a0MQ0000000KYyJ' for example), however my csv file contains the primary key in string form ('R1005').  Is there a means of retrieving the id by using the string form of the key and still using the dataloader?  I'd like to stay away from programming my own loader with the API if i can.


The best solution i've found so far is to export the master object first, and use it as a key for creating the csv.  If anyone has a better idea, let me know!


If you have a custom field on the master object marked as an "external id" field, usuallydata loader gives you the option to use that, instead of having to use salesforce IDs.