Skip to content

Instantly share code, notes, and snippets.

@dcarroll
Created March 17, 2014 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcarroll/9609997 to your computer and use it in GitHub Desktop.
Save dcarroll/9609997 to your computer and use it in GitHub Desktop.
global class CleanUpRecords implements Database.Batchable<sObject> {
global final String query;
global CleanUpRecords(String q) {
query = q;
}
global Database.QueryLocator start(Database.BatchableContext bc) {
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC, List<sObject> scope) {
delete scope;
}
global void finish(Database.BatchableContext BC) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment