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
p PILLIp PILLI 

batch apex coding examples please tell me any link website

Raj VakatiRaj Vakati
https://trailhead.salesforce.com/en/content/learn/modules/asynchronous_apex/async_apex_batch
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch.htm
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm
https://trailhead.salesforce.com/en/content/learn/projects/salesforce_developer_workshop/batch_and_schedule
https://webkul.com/blog/batch-apex/
https://www.tutorialspoint.com/apex/apex_batch_processing.htm
A G NagarajA G Nagaraj
Hi, below is the sample example for batch apex coding.

********************************

public class fieldupdate implements Database.Batchable<SObject>{
    public Database.querylocator start(Database.BatchableContext bc){
        string query = 'select name, industry from Account';
        return Database.getQueryLocator(query);
    }

    public void execute(Database.BatchableContext bc, list<Account> scope){
        list<Account> lst = new List<Account>();
        for(Account acc : scope){
            acc.industry = 'Energy';
            lst.add(acc);
        }
        update lst;
    }

    public void finish(Database.BatchableContext bc){
    }
}


**************
Hoping this will help you.
 
Deepali KulshresthaDeepali Kulshrestha
Hi p PILLI,

Please go through the given below link which may help you:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm

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