Tuesday, August 5, 2014

Skeleton code for Batchable/Schedulable classes

I wish Force.com IDE had a quick option to generate a skeleton class for Batchable classes.  It has one for test classes, so why not this one?  For now I just paste in my own skeleton code to save typing the same stuff every time.
global class BatchableSample implements Database.Batchable, Schedulable { global Database.Querylocator start(Database.BatchableContext context) { // TO-DO: construct the actual query return Database.getQuerylocator([Select Id From Account Where CreatedDate = TODAY]); } global void execute(Database.BatchableContext context, List scope) { } global void finish(Database.BatchableContext context) { }

// schedulable global void execute(SchedulableContext context) { } }

No comments:

Post a Comment