Skip to main content

Posts

Showing posts with the label Batch Apex

Batch APex Interview Questions

Salesforce Interview Question on Batch class What is Batch Apex? It is a class which is capable of accepting records in bulk and then depending upon the batch size the group of records are broken into Batches and are processed asynchronously. When should we use a batch class? We should batch apex when we are dealing with records in bulk mainly the record size above 10000 and cannot be handled by the normal DML operations. What is the basic structure of a Batch class? the basic structure of a batch consists of three methods: Start Execute Finish Describe each method of a batch class? Start method: Syntax: global Database.QueryLocator start(Database.BatchableContext BC) This method receives the batchable context variable as an argument and returns a query locator variable. Execute method: Syntax:  global void execute(Database.BatchableContext BC, List<Account> scope) This method receives the batchable context variable and an additiona...