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){}

}

1 Answer 1

5

Replace

global class accountbatch implements Database.Batchable<Account>

with

global class accountbatch implements Database.Batchable<sObject>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .