You need to first make sure that you have the Bulk API Hard Delete permission on your profile, which can only be enabled by an admin. Then in the Data Loader settings make sure the Bulk API is checked.
global class BatchDeletion implements Database.Batchable<sObject>, Schedulable
{
global BatchDeletion()
{
//constuctor
}
global Database.QueryLocator start(Database.BatchableContext bc)
{
//query to return all expired Case Share records
return Database.getQueryLocator([Select id from Account where Name='Test Account12']);
}
global void execute(SchedulableContext sc)
{
//execute the batch
BatchDeletion deleteCS = new BatchDeletion();
ID batchprocessid = Database.executeBatch(deleteCS);
}
global void execute(Database.BatchableContext BC, list<sObject> scope)
{
System.debug('## deleting '+scope.size()+' case share recs');
//delete list of expired Case Share records
delete scope;
DataBase.emptyRecycleBin(scope);
}
global void finish(Database.BatchableContext BC)
{
//no post processing
/* System.debug('## Batch Job Finished ##');
UpdateAccountFields m = new UpdateAccountFields ();
String sch = '20 30 8 10 2 ?';
system.schedule('Merge Job', sch, m);*/
}
}
You need to first make sure that you have the Bulk API Hard Delete permission on your profile, which can only be enabled by an admin. Then in the Data Loader settings make sure the Bulk API is checked.
global class BatchDeletion implements Database.Batchable<sObject>, Schedulable
{
global BatchDeletion()
{
//constuctor
}
global Database.QueryLocator start(Database.BatchableContext bc)
{
//query to return all expired Case Share records
return Database.getQueryLocator([Select id from Account where Name='Test Account12']);
}
global void execute(SchedulableContext sc)
{
//execute the batch
BatchDeletion deleteCS = new BatchDeletion();
ID batchprocessid = Database.executeBatch(deleteCS);
}
global void execute(Database.BatchableContext BC, list<sObject> scope)
{
System.debug('## deleting '+scope.size()+' case share recs');
//delete list of expired Case Share records
delete scope;
DataBase.emptyRecycleBin(scope);
}
global void finish(Database.BatchableContext BC)
{
//no post processing
/* System.debug('## Batch Job Finished ##');
UpdateAccountFields m = new UpdateAccountFields ();
String sch = '20 30 8 10 2 ?';
system.schedule('Merge Job', sch, m);*/
}
}
1) http://http://na1.salesforce.com/help/doc/en/configuring_the_data_loader.htm
Please check below post for screen shot
1) https://www.shellblack.com/data/recover-and-restore-deleted-records-using-the-data-loader/
Hard Delete from Batch job
1) https://help.salesforce.com/apex/HTViewSolution?id=000135460&language=en_US
All Answers
1) http://http://na1.salesforce.com/help/doc/en/configuring_the_data_loader.htm
Please check below post for screen shot
1) https://www.shellblack.com/data/recover-and-restore-deleted-records-using-the-data-loader/
Hard Delete from Batch job
1) https://help.salesforce.com/apex/HTViewSolution?id=000135460&language=en_US