2

I have tried to write a simple skeletal structure of the Batch apex class. I have included all the methods inside the batch apex.

However Im getting the below error message at the fist line of the code.

Class accountbatch must implement the method: System.Iterable Database.Batchable.start(Database.BatchableContext)

Please find the batch class below.

global class accountbatch implements Database.Batchable<Account> {
    global database.QueryLocator Start (Database.BatchableContext bc) {
        String query = 'select id,Name from Account';
        return Database.getQueryLocator(query);
    }
    global void execute (Database.BatchableContext bc,List<Account> scope){

    }
    global void finish (Database.BatchableContext bc){}

}
5

Replace

global class accountbatch implements Database.Batchable<Account>

with

global class accountbatch implements Database.Batchable<sObject>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.