You need to sign in to do that
Don't have an account?
PrasadBabu
More than 1 field provided in an external foreign key reference in entity: Account
Hi,
Currently i am working on posting of finacial data to salesforce. But while i am doing so i am getting an error "More than 1 field provided in an external foreign key reference in entity: Account"
Below is the message i am sending to salesforce,
<?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></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>External_Id__c</urn:externalIDFieldName>
<urn:sObjects xsi:type="Financial_Analysis__c">
<ACTUAL_SALES_YTD__C>23453245</ACTUAL_SALES_YTD__C>
<ACCOUNT__R>
<ns3:type>Account</ns3:type>
<SAP_CUSTOMER_ID__C>123456789</SAP_CUSTOMER_ID__C>
</ACCOUNT__R>
<MARGIN_YTD__C>1234567890</MARGIN_YTD__C>
<Sales_Type__c>Test Services</Sales_Type__c>
<Current_Financial_Year__c>2007</Current_Financial_Year__c>
<PROD_REF_TYPE__C>Test product type</PROD_REF_TYPE__C>
<BUSINESS_DIVISION__C>Services</BUSINESS_DIVISION__C>
<SERVICE_CATEGORY__C>Test Services</SERVICE_CATEGORY__C>
<EXTERNAL_ID__C>Test External ID</EXTERNAL_ID__C>
</urn:sObjects>
</tns1:upsert></SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<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></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>External_Id__c</urn:externalIDFieldName>
<urn:sObjects xsi:type="Financial_Analysis__c">
<ACTUAL_SALES_YTD__C>23453245</ACTUAL_SALES_YTD__C>
<ACCOUNT__R>
<ns3:type>Account</ns3:type>
<SAP_CUSTOMER_ID__C>123456789</SAP_CUSTOMER_ID__C>
</ACCOUNT__R>
<MARGIN_YTD__C>1234567890</MARGIN_YTD__C>
<Sales_Type__c>Test Services</Sales_Type__c>
<Current_Financial_Year__c>2007</Current_Financial_Year__c>
<PROD_REF_TYPE__C>Test product type</PROD_REF_TYPE__C>
<BUSINESS_DIVISION__C>Services</BUSINESS_DIVISION__C>
<SERVICE_CATEGORY__C>Test Services</SERVICE_CATEGORY__C>
<EXTERNAL_ID__C>Test External ID</EXTERNAL_ID__C>
</urn:sObjects>
</tns1:upsert></SOAP-ENV:Body>
</SOAP-ENV:Envelope>
can any one help me out in this. Why the error is for?
Thanks in advance,
Prasad Babu.
Superfell
You seem to be mixing enterprise & partner programming models, your request seems to be enterprise API based, but the account__r structure has a type child element that is for the partner API. I'd remove the type element and add an xsi:type attribute to the account__r element to correct match the expected useage for the enterprise API.