Created
June 29, 2015 04:31
-
-
Save tyoshikawa1106/3b5bcdf8e86abebe59e5 to your computer and use it in GitHub Desktop.
Standard Schedule Batch...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class SampleBatch implements Database.batchable<sObject>, Database.Stateful { | |
public Database.QueryLocator start(Database.BatchableContext BC) { | |
String query = ''; | |
query += ' SELECT '; | |
query += ' Id '; | |
query += ' FROM '; | |
query += ' Account '; | |
return Database.getQueryLocator(query); | |
} | |
public void execute(Database.BatchableContext BC, List<Account> accounts) { | |
} | |
public void finish(Database.BatchableContext BC) { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global class SampleBatchScheduler implements Schedulable { | |
global void execute(SchedulableContext SC) { | |
database.executebatch(new SampleBatch()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment