apex execute batch job
Id batchJobId = Database.executeBatch(new RunThisBatch(), 200);
apex execute batch job
Id batchJobId = Database.executeBatch(new RunThisBatch(), 200);
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) {
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us