+ Start a Discussion
SFDC_LanceSFDC_Lance 

Update master & detail objects in one shot using Bulk Api

How to update master & detail in one shot using Bulk Api.  

Currently we have CSHistory as Header & CSHistory Items as Details. 2 Objects in SFDC.

 

Can we able to create header and details in single shot? using bulk api. if so can you please show me an example

 

Thank you

 

Regards,

Lance

Ashish_SFDCAshish_SFDC

Hi Lance, 

 

If you have the master object records IDs then we may write a script in such a way but if the records are new then only an IMPORT with get them the IDs which is required to IMPORT the Child records. 

 

Master Detail relationships only link to the ID field of the parent record — you can't change this. That said, the UI uses the names for the convenience of users which is why you're not able to search via ID there.

 

Regards,

Ashish

SFDC_LanceSFDC_Lance

Hi Ashish,

What you think if I create a new object (say temp) which holds master + details and use the Bulk API to load data.

Once the Bulk API finish the job trigger/call a web service which will now move from this temp to respective master + detail.

 

Do you think that's acceptable solution

we are loading 10K records in Bulk API. Please advices - Thanks

 

Lance

Ashish_SFDCAshish_SFDC

Hi Lance, 

 

 

I dont think that would solve the problem as it will create an ID for each record once uploaded in the Temp Object and Bulk API etc. 

 

Instead try the Import wizard, see the H&T article below, 

 

http://help.salesforce.com/apex/HTViewHelpDoc?id=import_my_organizations_accounts_and_contacts.htm&language=en_US

 

 

Regards,

Ashish