+ Start a Discussion
MegachuckmcMegachuckmc 

Defining a Related Object in Data Loader

I'm setting up the process-conf.xml file to set up a series of Upsert processes and can't find a Configuraton Parameter for Related Objects...

 

'sfdc.externalIdField' allows me to specify the External ID field used for data matching which in the GUI corresponds to

 

Step 2a: Choose your field to use for matching --> sfdc.externalIdField

 

Step 2b: Choose your related objects --> ???

 

 

I can't find any mention of this in any of the Data Loader documentation...

 

Any help is greatly appreciated!

 

Mike

 

 

 

 

 


Best Answer chosen by Admin (Salesforce Developers) 
GoForceGoGoForceGo

As long as your mapping file (.sdl) maps correctly to foreign keys it  works. You can create this file using the UI version of Data Loader using step 2b. you describe 

 

Let's say you are trying to upsert B records that have a lookup to object A.

 

So in the process-conf.xml would only reference B's sfdc.externalIdField.

 

<entry key="sfdc.externalIdField" value="B_ID__c"/> (equivalent of step 2a).

 

The mapping file would have something to effect: 

 

A_ID =A__r\:A_ID__c (UI step 2b will generate this reference)

 

Where A_ID is the column name in your .csv file, A_ID__c is the external ID for your object A.

All Answers

GoForceGoGoForceGo

As long as your mapping file (.sdl) maps correctly to foreign keys it  works. You can create this file using the UI version of Data Loader using step 2b. you describe 

 

Let's say you are trying to upsert B records that have a lookup to object A.

 

So in the process-conf.xml would only reference B's sfdc.externalIdField.

 

<entry key="sfdc.externalIdField" value="B_ID__c"/> (equivalent of step 2a).

 

The mapping file would have something to effect: 

 

A_ID =A__r\:A_ID__c (UI step 2b will generate this reference)

 

Where A_ID is the column name in your .csv file, A_ID__c is the external ID for your object A.

This was selected as the best answer
MegachuckmcMegachuckmc

Thanks for this great explanation!

 

I had come to the same conclusion after much hand-wringing when I noticed that once I got the External Id fields set up properly then the Foreign keys just worked.  I think my problem was that the fields I created were so closely named that when I set up the .conf file I was using the wrong field. 

 

I appreciate your help! 

 

 

Mike

vanrentvanrent

Could I have just a little more explanation on this, please? Just getting started in Sales Force. I've got the mapping done successfully and can run the upsert through the Data Loader Wizard, but cannot get it to run from the command line. I'm unclear about 'B records' in the previous post.

 

I am trying to upsert Accounts. The field in my csv file is CID and the custom field in SalesForce is RMAcctNbr_c. What do I set the entry key value?

 

<entry key="sfdc.externalIdField" value="????"/>

 

When I run the command line, I'm getting the following message:

 

2012-11-12 13:57:56,821 ERROR [accountUpsert] progress.NihilistProgressAdapter d
oneError (NihilistProgressAdapter.java:58) - Field name provided, RMAcctNbr_c do
es not match an External ID for Account

 

Any help would be appreciated!

 

Connie

kishore ankishore an

connie, Are you sure the external id field is RMAcctNbr_c and not RMAcctNbr__c ( with 2 underscores before c). Usually when you create custom field, it would be <field name>__c.  Also make sure to check the external id on the field.

vanrentvanrent

Thank you, kishore....that was the problem!