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
PrasadBabuPrasadBabu 

Foreign key external ID:123456 not found for field SAP_External_Id__c in entity Warranty_Cases__c

Hi,
 
Currently i am working on  uploading "Service Orders" data to Salesforce.
I was able to upload the data successfully. But i don't know why its not working now?
 
I am using below structure to send the data,
 
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/"><urn:SessionHeader xmlns:urn="urn:enterprise.soap.sforce.com">
  <urn:sessionId>Session ID here</urn:sessionId>
</urn:SessionHeader><ReceiverID>Salesforce</ReceiverID></SOAP-ENV:Header><SOAP-ENV:Body>
<tns1:upsert xmlns:tns1="urn:enterprise.soap.sforce.com" xmlns:ens="sobject.enterprise.soap.sforce.com" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="urn:sobject.partner.soap.sforce.com">
  <urn:externalIDFieldName>SAP_EXTERNAL_ID__C</urn:externalIDFieldName>
  <urn:sObjects xsi:type="Open_Service_Order__c">
    <ORDER_DESCRIPTION__C>test</ORDER_DESCRIPTION__C>
    <NAME></NAME>
    <ORDER_STATUS__C></ORDER_STATUS__C>
    <ORDER_TYPE__C>Test</ORDER_TYPE__C>
    <WBS_ELEMENT_PROJECT_ID__C>Test</WBS_ELEMENT_PROJECT_ID__C>
    <SAP_EXTERNAL_ID__C>9123456789</SAP_EXTERNAL_ID__C>
    <Warranty_Case__r>
      <SAP_EXTERNAL_ID__C>123456</SAP_EXTERNAL_ID__C>
    </Warranty_Case__r>
  </urn:sObjects>
</tns1:upsert></SOAP-ENV:Body>
</SOAP-ENV:Envelope>
 
And the response i got was,
 
"Foreign key external ID:123456 not found for field SAP_External_Id__c in entity Warranty_Cases__c"
 
Could you please help me in getting the right structure? And could any one please tell me what might be the reason for this?
Is there any chance of having some thing changed at salesforce side? if so how can i monitor the changes at salesforce?
 
Thanks in advance.
 
Regards,
Prasad Babu.
SuperfellSuperfell
Your request says that the Open_Service_Order__c object that you're upserting is related to the Warrenty_Case__c object with a SAP_EXTERNAL_ID__C value of 123456.

The error is telling you there is no such Warrenty_Case__c row with a SAP_EXTERNAL_ID__C value of 123456.