Posts

Showing posts with the label Batch apex

Batch class salesforce

Batch apex is an interface given by salesforce to process large amount of data. As we know, salesforce provides governer limits on data extraction and DML operations in classes. In a SOQL query we can get only 50000 records and at once we can use only 10000 records in one DML operation. Total number of DML operations allowed in apex class is 150 hence we can process upto 1500000 records in an apex class. But to work on these many records in apex class we need to implement various complex loopings that will be tiring and time consuming job. Also for large scale industries the amount of data is more than 1500000 hence this approach cannot be used effectively. To overcome this problem, salesforce provides batch apex interface. This interface allows to process 50 million records without any complex logic and looping to implement. Batch is divided into 3 methods:-  1.  Query Locator  :- this methods runs as soon as batch stats running. This method is used to query the...