Created
December 20, 2016 13:44
-
-
Save enreeco/2bb77de86f3489a4a3db5792d0c4e7d6 to your computer and use it in GitHub Desktop.
Batch Apex Class
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
/** | |
* Title | |
* | |
* @author | |
* @version 1.0 | |
* @description | |
* @uses | |
* @history | |
* yyyy-mm-dd : | |
*/ | |
public without sharing class MyBatch implements Database.Batchable<sObject>, Database.Stateful, Schedulable, Database.AllowsCallouts { | |
public Iterable<sObject> start(Database.BatchableContext bc) { | |
return Database.getQueryLocator([Select Id From XXXX ...]); | |
} | |
public void execute(Database.BatchableContext bc, List<SObject> scope) { | |
for(SObject obj : scope){ | |
} | |
} | |
public void finish (Database.BatchableContext bc) { | |
} | |
public void execute(SchedulableContext SC) { | |
Database.executeBatch(new MyBatch(), 1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment