0

I am trying to update a batch class to allow me to schedule it, but I am getting this error:

Class must implement the following methods System.ScheduleableContext 

I understand the error, but given my code works when I manually execute the job I am not aware how to update it to still work and also be schedulable.

public class DataRefreshBatch implements Schedulable, Database.Batchable<SObject>, Database.Stateful, Database.AllowsCallouts{ public List<Jobs__c> start(Database.BatchableContext bc) { /*....*/ } public void execute(Database.BatchableContext bc, List<Jobs__c> scope) { /*....*/ } public void finish(Database.BatchableContext BC) { } } 

The error is in the first line, when I added "Scheduleable" after implements, I get an error in my IDE showing the error message above. My start method returns a list of records from a custom object that I then use in my execute method.

What modification is needed to allow me to make this class scheduleable and still keep the method signature the way it is on my execute method.

1 Answer 1

1

You need to include an execute(SchedulableContext) method. Typically:

public void execute(SchedulableContext context) { Database.executeBatch(this); } 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.