Skip to Content

TheBlogReaders.com

Salesforce.com, PHP, MySQL, Javascript, Ajax, Htacces

How to execute the batch apex class using developer console

Be First!
by February 22, 2013 APEX, SALESFORCE

How to execute the batch apex class using developer console?
Example:
Batch Apex Class:


global class accountList implements Database.Batchable<Sobject> {
global Database.querylocator start(Database.BatchableContext BC) {
return Database.getQueryLocator([select Id, Name from Account]);
}
global void execute(Database.BatchableContext BC, list<Account> scope) {
return Database.getQueryLocator(query);
}
global void finish(Database.BatchableContext BC) {
}
}

Execute the Batch Apex Class using Developer Console using below,


accountList objTest = new accountList();
Database.executebatch(objTest);

(2742)

Previous
Next

Leave a Reply