function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NANDHINI k 9NANDHINI k 9 

whether my program is correct or wrong?

global class UpdateTheValue implements Database.Batchable<Employee_Detail__c>
{
   global final String Query;
   global integer Available_Leave__c;
global SummarizeAccountTotal(String q)
{
       Query=q;
   }

   global Database.QueryLocator start(Database.BatchableContext BC){
      return Database.getQueryLocator(query);
   }
   
   global void execute(Database.BatchableContext BC,List<Employee_Detail__c> scope){
      for(Employee_Detail__c s : scope)
      {
         Available_Leave__c= Integer.valueOf(s.get('Available_Leave__c'))+4;
      }
       update scope;
   }

global void finish(Database.BatchableContext BC){
   }
}

Error:class UpdateTheValue must be implement method:system.iterable Database.Batchable.start.(Database.batchablecontext)
Prady01Prady01
Hi Nanshini. Please find the below sample batch class, Hope this helps!
 
global class yourclassname implements Database.Batchable<sObject>, Database.Stateful{

global Database.QueryLocator start(Database.BatchableContext bc){
	return database.getQuerylocator('SOQL query space! Eg: select id, name from account where name=\'SuperAccounts\'');
}

global void execute(Database.BatchableContext bc, List<SObject> scope) {
    
        List<Account> accs = (List<Account>)scope;
        Map<id,Account> accountsToupdate = new Map<id,Account>(); 
        for(Accounts acunts : accs){
        If(acunts.CustomNameFiled == 'world' && acunts.CustomNameFiled == null){
        	acunts.CustomNameFiled = 'Hello World';
        	accountsToupdate.add(acunts.id,acunts);
        }
	}
	update accountsToupdate.values();
}

global void finish(Database.BatchableContext bc){
        

}