[SalesForce] Class Must Implement the Global interface method: Iterable start Database

Given the following code:

global class MyBatch implements Database.Batchable<SObject> {

    global MyBatch() {}

    global void execute(Database.BatchableContext BC, List<MyBatch Field__c> batch)
    {

    }

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

What does this error Message mean?

MyBatch: Class must implement the global interface method:
Iterable<SObject> start(Database.BatchableContext) from
Database.Batchable<SObject>

Best Answer

It means that you're missing a particular method; the interface is trying to enforce the implementation of this class.

So adding this method to the MyBatch class will resolve the issue:

    global Database.Querylocator start (Database.BatchableContext BC)
{
       return Database.getQueryLocator(query);
}   
Related Topic