1

I have a contacts Data, I want to relate these data to parent Account using External ID in sales force. How I can do this using salesforce Partner WSDL and SOAP UI?

Please can any one help with sample xml for this operation. I know how I can upsert to single object with external ID.

<soapenv:Body>
  <urn:upsert>
     <urn:externalIDFieldName>Contact_Ext_ID__c</urn:externalIDFieldName>
     <!--Zero or more repetitions:-->
     <urn:sObjects>
        <urn1:type>Contact</urn1:type>
        <Contact_Ext_ID__c>12223333555</Contact_Ext_ID__c>
        <!--Zero or more repetitions:-->
        <urn1:FIRSTNAME>Barath3</urn1:FIRSTNAME>
        <urn1:LASTNAME>Kumar3</urn1:LASTNAME>

        <urn1:MailingStreet>No.1 2nd floor 3rd cross</urn1:MailingStreet>
       <urn1:MailingCity>Bangalore</urn1:MailingCity>
       <urn1:MailingState>Karnataka3</urn1:MailingState>
       <urn1:PHONE>98809801114</urn1:PHONE>
       <urn1:OWNERID>xxxx99999dd</urn1:OWNERID>
     </urn:sObjects>
  </urn:upsert>

1
  • If you use Java, have you tried Salesforce WSC to interact with Soap API? It is really easy with it.
    – metasync
    Sep 9, 2017 at 23:42

1 Answer 1

1

You need to specify the account, and its externalID field & vale e.g. if the externalID field on account is extId__C, and the relevant account has an ID of 00001 in this field, you'd do.

<soapenv:Body>
  <urn:upsert>
  <urn:externalIDFieldName>Contact_Ext_ID__c</urn:externalIDFieldName>
     <urn:sObjects>
        <urn1:type>Contact</urn1:type>
        <Contact_Ext_ID__c>12223333555</Contact_Ext_ID__c>

        <urn1:Account>
             <type>Account</type>
             <urn1:extId__c>00001</urn1:extId__c>
        </urn1:Account>

        <!--Zero or more repetitions:-->
        <urn1:FIRSTNAME>Barath3</urn1:FIRSTNAME>
        <urn1:LASTNAME>Kumar3</urn1:LASTNAME>
     </urn:sObjects>
  </urn:upsert>
2
  • Thanks for your reply. After making the changes you suggested, getting below error. <faultstring>Missing entity type information. sObject requires a separate 'type' field be sent.</faultstring> Sep 9, 2017 at 11:08
  • I updated the sample
    – superfell
    Sep 9, 2017 at 19:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .