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.


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.

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.

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

ParameterTypeDescription
batchSizeIntegerThe number of records to process per batch/queueable execution.

Returns DML_Builder.DML_AsyncBuilder — This DML_AsyncBuilder instance for fluent chaining.

Example

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