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
GoForceGoGoForceGo 

Using Data Loader to perform Delete using External Id

Doesn't seem like it is possible to use external ids to perform a delete operation using Data Loader?

 

I am already using Data Loader upsert to perform initial blulk data load and incremental insert/update.  I am automating the incremental insert/update using the batch mode of data loader.

 

How do I do automated deletes as they happen in external system? Seems like Data loader wants the actual salesforce ids...

 

 

 

 

 

Message Edited by GoForceGo on 04-28-2009 05:20 PM
GoForceGoGoForceGo

I was able to use data loader to automate this. Pain, but doable. I hope there is a better way. 

 

Anyone with better way of doing this? 

 

1. Add a field to every object called "Active". This is probably the least desirable part of the solution. By default this value is True.

2. Run three processes in batch mode using Data Loader

    a. Using ExternalId, upsert the records that I want to delete. Set Active  = false

    b. Run an extract with SOQL query [select id from xxx where Active__c = false). Save it to deletexxx.csv

    c. Run a delete  operation with deletexxx.csv.

 

 

RupBRupB

That is what I do, except that instead of creating a custom attribute and running step 1, I write a more elaborate SOQL query to select the objects which I want to delete.

However, I have not been able to get the batch delete process to work once I have a CVS file full of ids (ID column) : I keep on getting INVALID ID FIELD. When I delete these manually (in SF.com or manually in the DataLoader), all goes well.

Do I need a mapping file for delete operations ?  Mapping ID to Id sounds ridiculous ...

 

Any ideas ?

 

Rup

GoForceGoGoForceGo

I do have a mapping file that maps the extracted csv ID column to id column.Sounds ridiculous but seems like you need it.

 

 

 

 

RamonMedinaNJRamonMedinaNJ
Hello,

As explained deleting using "External Id" is not supported (should be but is not currently).

Another option would be to use the "External ID" to extract list of "Salesforce Id's", then run delete using extract of 
"Salesforce Id's" as input.
 
Jitterbit Dataloader has scheduling capabilities you can use via UI vs. command-line for the SFDC Apex Dataloader (overall the Jitterbit Dataloader is a bit more robust then the SFDC Apex Dataloader). You could look at automating the processes (to extract "Salesforce Id's" using your "External ID's", then run delete using extract of "Salesforce Id's" as input).
 
Thanks,
Ramon M