Quantcast
Viewing all articles
Browse latest Browse all 2504

Batch Create Core Object with Customer Object Child (1 Comment)

Topic by Alex Onslow

I'm writing a data import process, where contacts are created from a custom object table (ImpContact) containing the raw data. The custom object is a child of contact, and I'm having issues creating the relationship between the newly created contact and the custom object. Broadly, the process works as follows:

- The entire ImpContact table is read into memory

- The code scans each row and builds a contact object based on the data it contains

- Each contact is submitted to a batch request item

- The batch is run every 100 items

The problem is, I can create the contacts, but I don't know their IDs until after the batch has run, and therefor cannot link the ImpContact record. Previously, I was creating the records one at a time, so all I had to do was update the current record in ImpContact with the result of the single create contact operation I was running.

Is there any way to create a contact object that includes it's child custom (generic) objects? That way I can just submit both to the batch.


Viewing all articles
Browse latest Browse all 2504

Trending Articles