Skip to content

DML_Builder.DML_AsyncBuilder

Class

apex
global class DML_Builder.DML_AsyncBuilder

Async DML execution wrapper. Groups registered operations by type and delegates to PROC_ExecuteDML with UTIL_AsynchronousJobLauncher for adaptive async processing.

Since: 1.0


Methods

MethodDescription
global void execute()Enqueues the registered DML operations for asynchronous execution.
global DML_Builder.DML_AsyncBuilder withBatchSize(Integer batchSize)Sets the batch size for async processing.

Method Details

execute

apex
global void execute()

Enqueues the registered DML operations for asynchronous execution. Groups records by operation type and launches one async job per type.

Since: 1.0

Example:

apex
DML_Builder.newTransaction()
    .doUpdate(records)
    .allowPartial()
    .async()
    .execute();

withBatchSize

apex
global DML_Builder.DML_AsyncBuilder withBatchSize(Integer batchSize)

Sets the batch size for async processing.

Parameters:

  • batchSize (Integer) - The number of records to process per batch/queueable execution.

Returns: DML_Builder.DML_AsyncBuilder - This DML_AsyncBuilder instance for fluent chaining.

Since: 1.0

Example:

apex
DML_Builder.newTransaction()
    .doDelete(records)
    .async()
    .withBatchSize(200)
    .execute();