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>


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);
  • 2
    n.b. Unless you are doing managed packages, you can use public rather than global as access modifier throughout your batch class
    – cropredy
    May 20 '15 at 22:25
  • @crop1645 That's good to know. Thank you!
    – chrisjlee
    May 21 '15 at 2:49
  • 1
    yep - I learned it from @sfdcfox who knows everything
    – cropredy
    May 22 '15 at 9:17
  • You can write a batch in a managed package that uses public rather than global too. Global is only needed to expose the class or method to code outside the package.
    – Phil W
    Mar 8 '19 at 0:27

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.