Skip to content

FLOW_ExecuteValidationRules.DTO_Request

Class

apex
global inherited sharing class FLOW_ExecuteValidationRules.DTO_Request

Request DTO for the Execute Validation Rules invocable action. Contains the records to validate and the trigger context for rule evaluation.

Since: 1.0


Fields

FieldDescription
global List oldRecordsThe previous record values before the change.
global List recordsThe new/current records to validate.
global String triggerContextThe trigger operation context that determines which validation rules to execute.

Field Details

oldRecords

apex
@InvocableVariable(description='The previous record values before the change. Required for BEFORE_UPDATE and AFTER_UPDATE to enable change detection in validation formulas. Leave empty for insert, delete, and undelete operations.' label='Old Records') global List<SObject> oldRecords

Type: List

The previous record values before the change. Required for BEFORE_UPDATE and AFTER_UPDATE operations to enable change detection in validation formulas (e.g., ISCHANGED, PRIORVALUE functions). Leave empty for insert, delete, and undelete operations. In Record-Triggered Flows, use {!$Record__Prior} to populate this field.

Since: 1.0

records

apex
@InvocableVariable(required=true description='The new/current records to validate. For insert: the records being created. For update: the records with new values. For delete: the records being deleted.' label='Records') global List<SObject> records

Type: List

The new/current records to validate. For insert operations, these are the records being created. For update operations, these are the records with their new field values. For delete operations, these are the records being deleted. This field is required.

Since: 1.0

triggerContext

apex
@InvocableVariable(description='The trigger operation context matching TriggerOperation enum: BEFORE_INSERT, BEFORE_UPDATE, BEFORE_DELETE, AFTER_INSERT, AFTER_UPDATE, AFTER_DELETE, or AFTER_UNDELETE.' label='Trigger Context') global String triggerContext

Type: String

The trigger operation context that determines which validation rules to execute. Must match a TriggerOperation enum value: BEFORE_INSERT, BEFORE_UPDATE, BEFORE_DELETE, AFTER_INSERT, AFTER_UPDATE, AFTER_DELETE, or AFTER_UNDELETE. Defaults to BEFORE_INSERT if not specified.

Since: 1.0