You need to sign in to do that
Don't have an account?
Hari nadh babu Eluru
Running Batch in Execute Anonymous but throwing error: Method does not exist or incorrect signature: void executeBatch(UpdateGender, Integer) from the type Database
Hi all, I did this batch apex code.
Please resolve my issue problem. Thank you to all
public class UpdateGender { public database.querylocator start(database.batchableContext abc){ string a = 'SELECT Student_Id__c, Name, Gender__c FROM Student__c'; return database.getquerylocator(a); } public void execute(database.batchableContext def, list<Student__c> x){ for(Student__c a : x){ if(a.Gender__c == 'Male'){ a.Name = 'Mr'+a.Name; } else if(a.Gender__c == 'Female'){ a.Name = 'Mrs'+a.Name; } } update x; } public void finish(database.batchableContext ghi){ system.debug('Finish::!'); } }I wrote executed code in anonymous windows is as follows above
UpdateGender obj = new UpdateGender(); database.executeBatch(obj,10);While i'm executing this batch in anonymous window they were showing error as below image
Please resolve my issue problem. Thank you to all
Below is the syntax for the batch class. I done see you are implementing Database.Batchable interface. Can you try modifying it.
If this solution helps, Please mark it as best answer.
Thanks,
All Answers
Below is the syntax for the batch class. I done see you are implementing Database.Batchable interface. Can you try modifying it.
If this solution helps, Please mark it as best answer.
Thanks,