Answers for "batch class in salesforce"

2

apex execute batch job

Id batchJobId = Database.executeBatch(new RunThisBatch(), 200);
Posted by: Guest on June-28-2020
0

batch class in salesforce

// Batch Job for Processing the Records

  global class batchAccountUpdate implements Database.Batchable<sObject> {

// Start Method

    global Database.QueryLocator start(Database.BatchableContext BC) {

        String query = 'SELECT Id,Name FROM Account';

        return Database.getQueryLocator(query);

    }

   // Execute method

    global void execute(Database.BatchableContext BC, List<Account> scope) {

         for(Account a : scope)

         {a.Name = a.Name + 'Updated';            

         }

         update scope;

    }   

    // Finish Method

    global void finish(Database.BatchableContext BC) {

    }

}
Posted by: Guest on May-27-2021

Code answers related to "batch class in salesforce"

Browse Popular Code Answers by Language