PROC_UpdateFields
Class · Group: Bulk DML
global inherited sharing class PROC_UpdateFields implements IF_Async.ProcessableImplements: IF_Async.Processable
Known Derived Types: IF_Async.Processable.execute(List<Object>)
Processor for bulk field updates using the adaptive async framework. Implements IF_Async.Processable to enable automatic selection between Queueable and Batch execution. Supports REPLACE, PREFIX, and SUFFIX update methods for flexible field value manipulation.
Since: 1.0
Example:
PROC_UpdateFields.DTO_Parameters params = new PROC_UpdateFields.DTO_Parameters();
params.objectName = 'Account';
PROC_UpdateFields.DTO_Field field = new PROC_UpdateFields.DTO_Field();
field.name = 'Description';
field.value = 'Updated via bulk processor';
params.updateFields.add(field);
PROC_UpdateFields processor = new PROC_UpdateFields(params);See Also: IF_Async.Processable, UTIL_AsynchronousJobLauncher
Properties
| Property | Description |
|---|---|
| global enum FieldUpdateMethod | Enum defining methods for updating SObject fields. |
Methods
| Method | Description |
|---|---|
| global IF_Queryable buildQueryable() | Builds a queryable for the configured object and fields. |
| global void execute(List<Object> items) | Executes the field update operation on the provided list of records. |
| global PROC_UpdateFields(PROC_UpdateFields.DTO_Parameters parameters) | Constructs a field update processor with the specified parameters. |
Inner Classes
| Class | Description |
|---|---|
| DTO_Field | DTO representing a field to update on an SObject. |
| DTO_Parameters | DTO for parameters to query and update records. |
Method Details
PROC_UpdateFields
global PROC_UpdateFields(PROC_UpdateFields.DTO_Parameters parameters)Constructs a field update processor with the specified parameters.
Parameters:
parameters(PROC_UpdateFields.DTO_Parameters) - The parameters defining which fields to update and how.
Since: 1.0
Example:
PROC_UpdateFields.DTO_Parameters params = new PROC_UpdateFields.DTO_Parameters();
params.objectName = 'Account';
PROC_UpdateFields processor = new PROC_UpdateFields(params);buildQueryable
global IF_Queryable buildQueryable()Builds a queryable for the configured object and fields.
Returns: IF_Queryable - An IF_Queryable instance for retrieving records to update.
Since: 1.0
Example:
PROC_UpdateFields.DTO_Parameters params = new PROC_UpdateFields.DTO_Parameters();
params.objectName = 'Account';
PROC_UpdateFields.DTO_Field field = new PROC_UpdateFields.DTO_Field();
field.name = 'Name';
params.updateFields.add(field);
IF_Queryable query = new PROC_UpdateFields(params).buildQueryable();execute
global void execute(List<Object> items)Executes the field update operation on the provided list of records.
Parameters:
items(List) - The list of SObject records to update.
Since: 1.0
Example:
PROC_UpdateFields.DTO_Parameters params = new PROC_UpdateFields.DTO_Parameters();
PROC_UpdateFields.DTO_Field field = new PROC_UpdateFields.DTO_Field();
field.name = 'Name';
field.value = 'Updated';
params.updateFields.add(field);
List<Account> accounts = [SELECT Id, Name FROM Account LIMIT 100];
new PROC_UpdateFields(params).execute(accounts);