Recent questions tagged batch-apex-in-salesforce

Description : When a BatchApexworker record is created?

Last Answer : Ans: For each 10,000 AsyncApexJob records, Apex creates one additional AsyncApexJob record of type BatchApexWorker for internal use.

Description : What is AsyncApexJob object?

Last Answer : Ans: AsyncApexJob is Represents an individual Apex sharing recalculation job. Use this object to query Apex batch jobs in your organization.

Description : What is Database.AllowCallouts?

Last Answer : Ans: To use a callout in batch Apex, you must specify Database.AllowsCallouts in the class definition. For example: global class SearchAndReplace implements Database.Batchable, Database.AllowsCallouts ... } Callouts include HTTP requests as well as methods defined with the webService keyword.

Description : What is Database.State full interface?

Last Answer : Ans:To maintain variable value inside the Batch class, Database.Stateful is used. 

Description : How many batch jobs can be added to queue?

Last Answer : Ans: Queued counts toward the limit of 5. 

Description : How to track the details of the current running Batch using BatchableContext?

Last Answer : Ans: You can check the AsyncApexJob.Status using the JobId from the Database.BatchableContext. 

Description : What is the Database.BatchableContext?

Last Answer : Ans: BatchableContext Interface is Represents the parameter type of a batch job method and contains the batch job ID. This interface is implemented internally by Apex.

Description : What is the maximum size of the batch and minimum size of the batch ?

Last Answer : Ans: The default batch size is 200 records. min? max? 

Description : Batch is synchronous or Asynchronous operations?

Last Answer : Ans: Asynchronous operations. 

Description : How many callouts we can call in batch apex?

Last Answer : Ans: Batch executions are limited to one callout per execution.

Description : Can we call another batch apex from batch apex?

Last Answer : Ans: Yes you can call a batch apex from another batch apex .Either in start method or in finish method you can call other batch

Description : Can we call callouts from batch apex?

Last Answer : Ans: Yes we can call. 

Description : What is the scope of execute method?

Last Answer : Ans: The maximum value for the optional scope parameter is 2,000 

Description : How many times execute method is called?

Last Answer : Ans: Execute method is called for each batch of records. 

Description : What is the use of execute method? 

Last Answer : Ans: Contains or calls the main execution logic for the batch job. 

Description : What is the iterable?

Last Answer : Ans: If you use an iterable, the governor limit for the total number of records retrieved by SOQL queries is still enforced.

Description : What is the Database.QueryLocator?

Last Answer : Ans: If we use a Database.QueryLocator, the governor limit for the total number of records retrieved by SOQL queries is bypassed. (Default 50,000 It allow up to 50 million records). 

Description : What is purpose of start method in batch apex?

Last Answer : Ans: It collect the records or objects to be passed to the interface method execute.

Description : Define the methods in batchable interface?

Last Answer : Ans: Start: global Database.Querylocator start (Database.BatchableContext bc){} Execute: global void execute(Database.BatchableContext bc,List ){} Finish: global void finish(Database.BatchableContext bc) {}

Description : What is Database.Batchable interface?

Last Answer : Ans: The class that implements this interface can be executed as a batch Apex job. 

Description : What is the need of batch apex?

Last Answer : Ans: By using Batch apex classes we can process the records in batches in asynchronously. 

Description : What are the transaction limitations in apex?

Last Answer : Ans: Each execution of a batch Apex job is considered a discrete transaction. For example, a batch Apex job that contains 1,000 records and is executed without the optional scope parameter from ... but the second fails, the database updates made in the first transaction are not rolled back.

Description : What are the soql limitations in apex?

Last Answer : Ans: Total number of records retrieved by SOQL queries-50,000 

To see more, click for the full list of questions or popular tags.