You need to sign in to do that
Don't have an account?
Chinni reddy
Class BatchApexExample must implement the method: void Database.Batchable<SObject>.execute(Database.BatchableContext, List<SObject>)
Hi,
I am executing Batch Apex this type of error showing can you please solve my problem
(Line: 2, Column: 10
Method does not exist or incorrect signature: void executeBatch(BatchApexExample) from the type Database.
this is my code:
global class BatchApexExample implements DataBase.Batchable<sObject>
{
global String query = 'oppartunaty';
global DataBase.QueryLocator start(DataBase.BatchableContext bc)
{
string query='select id,name,amount, Discription from oppartunaty';
return Database.getQueryLocator(query);
}
global void execute(DataBase.BatchableContext bc, List<oppartunaty> records){
for(oppartunaty opp: records)
{
opp.amount=2000;
opp.Discription='this my first batch Apex';
}
update records;
// process each
}
global void finish(Database.BatchableContext bc){
//procee
}
}
I am executing Batch Apex this type of error showing can you please solve my problem
(Line: 2, Column: 10
Method does not exist or incorrect signature: void executeBatch(BatchApexExample) from the type Database.
this is my code:
global class BatchApexExample implements DataBase.Batchable<sObject>
{
global String query = 'oppartunaty';
global DataBase.QueryLocator start(DataBase.BatchableContext bc)
{
string query='select id,name,amount, Discription from oppartunaty';
return Database.getQueryLocator(query);
}
global void execute(DataBase.BatchableContext bc, List<oppartunaty> records){
for(oppartunaty opp: records)
{
opp.amount=2000;
opp.Discription='this my first batch Apex';
}
update records;
// process each
}
global void finish(Database.BatchableContext bc){
//procee
}
}
You can relate your code with it,
It will help you a lot;
Greetings to you!
I have fixed the error in your code. Now you can use this code.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha.
Please update your code as following code. I have tested in my org and it is working perfectly fine. There was a problem of spelling of 'Opportunity' object and its fields in your code.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
It is very help full to me
which one is correct. please mark the correct one as Best Answer.
Thanks!