[SalesForce] Data Loader using self relationship lookup and external id

I'm currently using Jitterbit Dataloader.

I have an object called 'Project' and it has a self relationship (lookup) called 'Parent Projects'. During an initial import there are no parent projects so the import fails with

"Foreign Key External ID XXXXX not found for field … "

This error makes sense because the parent project doesn't exist yet.

As for now, I've done an initial upsert without the Parent ID. Then I do a second upsert with the Parent ID. However, I'm going to be scheduling this to run constantly and just wondering how others handle this situation. It doesn't seem very efficient to do two passes when upserting the data.

What is the best practice for this type of situation?

Any suggestions?

Best Answer

Have you tried setting batch size to one? You might find this question helpful also: Workbench - Inserting Records with Self Lookup via Smart Lookup

Related Topic