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
Aki99Aki99 

delete records using bulk api in java

Hi,
I am trying to delete all records in my sObject using Bulk API in java.
I am using the following code for the same:
private JobInfo createJob(String sobjectType, BulkConnection connection) throws AsyncApiException {
       
        JobInfo job = new JobInfo();
       
        job.setObject(sobjectType);
        job.setOperation(com.sforce.async.OperationEnum.delete);
        job.setContentType(ContentType.CSV);
       
       
        job = connection.createJob(job);
       return job;
}
code from :http://www.salesforce.com/us/developer/docs/api_asynch/Content/asynch_api_code_walkthrough.htm
I am using a csv with ids of all the records to be deleted.
When I run the code it gives me the error as : "ENTITY_IS_DELETED:entity is deleted:--"

Any idea how can I overcome the above error?

Thanks in advance,

Regards,
Aakash
Ramu_SFDCRamu_SFDC
Two reasons I can think off 1. The record/(s) may have been deleted manually or through some other way prior to executing this code.  2. There could be multiple instances within the same code where the records were already deleted and the DML command is issued again to delete the same records.

Is it showing any ID in specific in the error message?
Aki99Aki99
Hi,
Thanks for such a prompt reply.
No the error do not show any specific ID and the records are not deleted at any point in the code as they are still present in my sfdc instance.