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
JasonLincolnJasonLincoln 

DataLoader 16.0 Command Line Upsert with Relationships?

Can the upsert with relationships be used with Data Loader's command line?  If so, are there any examples of an SOQL statement that will do this?  I am attempting to pull Customer data from Oracle R12 and migrate this to SF but need to also include location and owner (account manager) data.  One is a reference from Account and the other is a reference to Account (child).  I can pull the data from Oracle using DataLoader's command line and upsert SF but I don't know how to get the owner id (unknown in Oracle) or the location id (also unknown in Oracle).  This is a one way interface.
Best Answer chosen by Admin (Salesforce Developers) 
Cool_DevloperCool_Devloper

You can now use External ID's to map the related records in your feed;)

This was demonstrated at dreamforce recently. Instead of mapping with the 18 digit Salesforce ID (unknown to Oracle), you can create an external ID field which can accept value from oracle data in both the related records, and then map these while doing the upsert.

I am not too sure what that field would be, but any primary key would do.

Cool_D 

All Answers

bytor1971bytor1971
I was able to figure out how to perform the upsert with relationships using the Data Loader command line utility.
WmWm
The owner id which data loader expects is the Salesforce unique id which yu can get from Oracle. One way to do is to pull out the records based on the owner and then update the excel with the owner id from salesforce and upload the data. You can try the import wizard which can look for owner names if the number of records is not very huge.
Cool_DevloperCool_Devloper

You can now use External ID's to map the related records in your feed;)

This was demonstrated at dreamforce recently. Instead of mapping with the 18 digit Salesforce ID (unknown to Oracle), you can create an external ID field which can accept value from oracle data in both the related records, and then map these while doing the upsert.

I am not too sure what that field would be, but any primary key would do.

Cool_D 

This was selected as the best answer
bytor1971bytor1971

Cool_Devloper,

 

That is what I did.

 

Thanks,

Jason

Cool_DevloperCool_Devloper

Gr8 Jason!

Way to go;)

Cool_D 

VoIP SolutionsVoIP Solutions

Hello folks,


I am having difficulty with using external keys for upserts through the command line.  

 

In particular:

I have some large upserts that work perfectly well through the graphical interface, but  when I run them on the command line it tells me it cannot find the fields in question.

 

2010-01-25 22:06:35,770 ERROR [RoleUpdate] client.PartnerClient loadUpserts (PartnerClient.java:616) - Error while calling web service operation: upsert, error was: No such column 'package__Location__r:package__XKey_LocationID__c' on entity 'package__Roles2__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

[InvalidFieldFault [ApiQueryFault [ApiFault  exceptionCode='INVALID_FIELD'

 exceptionMessage='No such column 'lichen__Location__r:lichen__XKey_LocationID__c' on entity 'lichen__Roles2__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.'

]

 row='-1'

 column='-1'

]

 

Indeed there is such a column and when I go through the UI with the exact same arguments, the upsert works just fine.

 

Does anyone have any advice on this one?

 

Thank you in advance.

Vern2Vern2

 

Make sure you've set the sfdc.externalIdField parameter. See details in the developer guide: http://na1.salesforce.com/help/doc/en/salesforce_data_loader.pdf

 

Even more details are available on my blog:

 

http://vernsconsciousness.blogspot.com/2011/02/salesforce-data-loader-quick-start.html

VoIP SolutionsVoIP Solutions

I thought the sfdc.externalIdField parameter was for THE external key for the object in question. 

 

We have several related objects that are being upserted into fields - do they each need their own sfdc.externalIdField parameter included? 

VoIP SolutionsVoIP Solutions

By the way, I may have resolved this by upgrading - I think I need to doublecheck and see if its still a problem.

jaslozjasloz

Hi, Did you solve  this, I am having the same problem.  I suspect I am missing and entry key in the process-conf.xml but won'd know what to enter?

 

Thanks

VoIP SolutionsVoIP Solutions
Upgrading to the latest data loader seemed to solve the problem.
jaslozjasloz

I found it:

 

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

 

More details here: https://na1.salesforce.com/help/doc/en/loader_params.htm