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
SKalidhasanSKalidhasan 

Bulk API & Foreign Key Resolution on Lookup Fields

We are designing an Integration leveraging Bulk API & Enterprise WSDL. The target Force.com Object has few Lookup Fields. Wanted to understand how to automatically resolve the Foreign Key.

 

For instance we have a Master Object "Geo Area" with values like 'APAC', 'EALA' etc.... Another Force.com Object called "SAP OM" which is the actual Object into which the integration upserts data has a lookup Field called "Client Geo Area" which looks up to "Geo Area" Master Object. The source system will only push values like 'APAC' or 'EALA' etc via the integration which we need to store into the lookup Field. However the Lookup Field expects the Row Id of the Master Values and not the actual Values.

 

How do we resolve this?

vbsvbs
Try using external Id's. Set up the field which has these foreign key values on "Geo Area" as external Id. When doing an upsert on the child object pass in the field name on the child that contains the lookup to the external field value in the parent. I hope I am making it clear. Try reading up further on External Id fields in salesforce and the upsert function call using API.