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
rsk_1980rsk_1980 

Delete Parent Child Relationship using Apex Data Loader

Beginning Winter '07, we can create Parent Child Relationships
while loading data using the Apex Data Loader.
For example:
I have the Account object with External ID = ERP_Id__c
In my org, one Account can be the Parent of the other.
 
Using the Data Loader, I am able to tie one account to the other
by defining the Parent field of the account being upserted
as a lookup (using the External ID) against all the available accounts.
 
The sdl entry for this is shown below
(left side = Input file header, right side = SFDC field):
Parent_ID=Parent\:ERP_Id__c
This works perfect when
- an exact match is found
- when an exact match is not found
 
However, when one account gets disconnected from its parent in the source ERP system,
I am sending an empty string for Parent_ID.
 
But the parent child relationship does not get deleted.
 
Does anybody have any ideas on how I can delete the Parent-Child relationship
using the data loader configuration and/or the input file data?
 
Regards,
Shiv.
 
PS: I have already tried the input data = single space for the Parent_ID field.
benjasikbenjasik
Have you tried the option "Insert null values"?
rsk_1980rsk_1980
Hi Benji,
Thanks for your response.
 
Setting the "Insert null values" option does not work.
The data loader does not flag an error either, which indicates
that it did not bother to perform a lookup for the Parent Account using the empty string.
 
Regards,
Shiv.