You need to sign in to do that
Don't have an account?
Nick Verschueren
Batch class must implement the method void database.batchable
Hi, I have following code, it's not much yet but I was trying to make a batch class. I just made the query and wanted to deploy to see if it works.
But when I deploy I get following message:
global class KBO_Batch implements Database.Batchable<sObject> { global Database.QueryLocator start(Database.BatchableContext bc) { return Database.getQueryLocator([SELECT Id FROM KBO_data]); } global void execute(Database.BatchableContext bc, List<IttesIT_KBO_data> records){ // process each batch of records } global void finish(Database.BatchableContext bc){ // execute any post-processing operations } }
But when I deploy I get following message:
force-app\main\default\classes\KBO_Batch.cls Class IttesIT_KBO_Batch must implement the method: void Database.Batchable<SObject>.execute(Database.BatchableContext, List<SObject>) (1:14)
I double checked, copied new examples from the tutorials, but still it gives me this error...
Check whether this IttesIT_KBO_data name is correct or not as you are querying data KBO_data.
Database.BatchableContext bc, List<KBO_data> records
or in general you can have Database.BatchableContext bc, List<Sobject> records. the error will go away.
If it helps mark it as best answer.
Thanks!
All Answers
Check whether this IttesIT_KBO_data name is correct or not as you are querying data KBO_data.
Database.BatchableContext bc, List<KBO_data> records
or in general you can have Database.BatchableContext bc, List<Sobject> records. the error will go away.
If it helps mark it as best answer.
Thanks!
that's my mistake, i was anomimizing some names but forgot one. The names were the same, but it pointed me to another mistake in the name of my object so it did solve my problem.
Thanks!