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

Help with using External ID as foreign key for Upsert call with the partner wsdl

Does anyone have a sample of what the SOAP message structure looks like for making an upsert call, with the partner wsdl, where the master record's external ID is used as the foreign key (rather than the salesforce ID)?.  I saw some examples of how to do this in code, using the enterprise wsdl, but not sure how the SOAP message looks for the partner wsdl.  I am trying to test this using XMLSpy, so I need the actual SOAP structure.
Here is the body of the SOAP message I currently use, but it requires the salesforce ID as the foreign key "Sales_Order__c" :
  <m:upsert xmlns:m="">
<upsert xmlns:="">

This upserts a contact using the masterId__c field on contact, and additional uses the duns__c field on account to resolve the relationship to account.

for your example you probably want something like


Fantastic!!   Thanks...  This will save me lots of code!!

What if I need to do a lookup based on multiple fields?  Do I just add in the 2nd field under the 1st?  It sounds logical but want to make sure.




Peter KempPeter Kemp

Did you ever find an answer to this? I'm not sure that you can concatenate ExternalIDfields.  The api certainly doesn't let you.  Does SOAP allow it?





No sure have not but if you got some info I would like to hear it.