Skip to content

FLOW_ExecuteValidationRules.DTO_Request ​

Class · Group: Validation

Learn it: Validation guide

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.


Fields ​

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

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, so a rule can tell whether a field changed: the rule compares the field's old and new values, for example newRecord.Phone against oldRecord.Phone, with a picklist field turned into text first, as in TEXT(newRecord.Industry) against TEXT(oldRecord.Industry) (ISCHANGED and PRIORVALUE are not available). Leave empty for insert, delete, and undelete operations. In Record-Triggered Flows, use {!$Record__Prior} to populate this field.

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.

triggerContext ​

apex
@InvocableVariable(description='Pick the trigger context whose validation rules should run, from Before Insert to After Undelete. Stored values match the TriggerOperation enum (for example BEFORE_INSERT); the field shows the stored value.' label='Trigger Context' placeholderText='BEFORE_INSERT' defaultValue='BEFORE_INSERT') 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.