1
votes

I have a custom object in SalesForce called Deal, which is a child of the built-in Account object. I am trying to use the Bulk XML API to upload a batch of records, but I can't seem to figure out how to specify this relationship correctly. From the documentation it says that you should reference a custom object's relationships like so:

<Relationship__r>
   <sObject>
      <some_indexed_field>#####</some_indexed_field>
   </sObject>
</Relationship__r>

If you have any idea how to specify a relationship to the Account object from a custom object I'd really appreciate it.

Added

The Deal object has the following 2 fields:

  • DealID
    • API Name - DealID__c
    • Data Type - Text(255)(External ID)(Unique Case Sensitive)
  • Account
    • API Name - Account__c
    • Data Type - Master-Detail(Account)

Request XML:
<Account__r>
<sObject>
<ID>0013000000kcWpfAAE</ID>
</sObject>
</Account__r>

Result XML:
<result>
<errors>
<message>Field name provided, Id is not an External ID or indexed field for Account</message>
<statusCode>INVALID_FIELD</statusCode>
</errors>
<success>false</success>
<created>false</created>
</result>

2

2 Answers

1
votes

There appears to be a bug and you have to strip out all whitespace and newlines when dealing with reference objects.

Check out:

http://success.salesforce.com/ideaview?id=08730000000ITQ7AAO

0
votes

From the docs

<RelationshipName>
<sObject>
    <IndexedFieldName>[email protected]</IndexedFieldName>
</sObject>

Everything looks good, but instead of using "ID" for the Indexed Field Name, you need to use "Account__c". That should take care of your issue.