Batch Apex in Salesforce is a special type of Apex class that processes large volumes of records asynchronously, dividing the work into smaller chunks called batches. Running Batch Apex from the Developer Console allows developers and administrators to manually trigger a batch job on demand — without deploying a Scheduled Apex class or using the Salesforce UI. This approach is useful for one-time data processing, testing batch job logic, or performing maintenance operations. The Apex class being executed must implement the Database.Batchable interface.
Database.executeBatch() method. This method takes two arguments: a new instance of your Batch Apex class (which must implement Database.Batchable), and an optional Integer specifying the batch size — that is, how many records to process in each chunk. The default batch size is 200 records; the maximum is 2,000 records. The method returns a Job ID.For example, to execute a batch class named RunThisBatch with a batch size of 200 records, call Database.executeBatch(new RunThisBatch(), 200). Store the returned value in a variable (e.g., batchJobId) to capture the Job ID for monitoring.
Note: The Job ID returned by Database.executeBatch() corresponds to an AsyncApexJob record. You can query the AsyncApexJob object using the Job ID to check the batch job's status, number of batches processed, and any errors.
000385654

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.