DTO_FlowValidationError
Class · Group: Data Transfer Objects
global inherited sharing class DTO_FlowValidationErrorRepresents a single validation error or warning for Flow display. Contains details about the validation rule that failed, the error message, and metadata for field-level error presentation in Flow screens. This class is a top-level global class to support LWC Flow screen components, as Apex inner classes cannot be used as property types in LWC configurations.
Since: 1.0
Example:
DTO_FlowValidationError error = new DTO_FlowValidationError();
error.ruleName = 'RequireEmail';
error.message = 'Email is required';
error.fieldName = 'Email__c';
error.severity = 'Error';See Also: FLOW_ExecuteValidationRules, UTIL_ValidationRule.ValidationError
Fields
| Field | Description |
|---|---|
| global String fieldName | The API name of the field associated with this error, if specified in the validation rule's FieldApiName__c field. |
| global Boolean isShadowMode | True if this error was generated by a validation rule running in shadow mode. |
| global String message | The user-facing error message from the validation rule's ErrorMessage__c field. |
| global Integer recordIndex | The zero-based index of the record in the input collection that generated this error. |
| global String ruleName | The DeveloperName of the ValidationRule__mdt record that generated this error. |
| global String severity | The severity level of this validation result. |
Field Details
fieldName
@InvocableVariable(label='Field Name') global String fieldNameType: String
The API name of the field associated with this error, if specified in the validation rule's FieldApiName__c field. May be null for record-level validation errors. Use this to highlight specific fields in the UI or position error messages near fields.
Since: 1.0
Example:
String value = instance.fieldName;isShadowMode
@InvocableVariable(label='Is Shadow Mode') global Boolean isShadowModeType: Boolean
True if this error was generated by a validation rule running in shadow mode. Shadow mode errors are logged for monitoring but do not block the save operation. Use this to distinguish between real errors and shadow mode observations in the UI.
Since: 1.0
Example:
Boolean value = instance.isShadowMode;message
@InvocableVariable(required=true label='Message') global String messageType: String
The user-facing error message from the validation rule's ErrorMessage__c field. This message should be displayed to end users and may contain merge field values.
Since: 1.0
Example:
String value = instance.message;recordIndex
@InvocableVariable(label='Record Index') global Integer recordIndexType: Integer
The zero-based index of the record in the input collection that generated this error. Use this to correlate errors with specific records when validating multiple records in a single request.
Since: 1.0
Example:
Integer value = instance.recordIndex;ruleName
@InvocableVariable(required=true label='Rule Name') global String ruleNameType: String
The DeveloperName of the ValidationRule__mdt record that generated this error. Use this to identify which specific rule failed for debugging or custom error handling.
Since: 1.0
Example:
String value = instance.ruleName;severity
@InvocableVariable(required=true label='Severity') global String severityType: String
The severity level of this validation result. Either 'Error' for blocking validation failures or 'Warning' for non-blocking informational messages. Corresponds to UTIL_ValidationRule.SEVERITY_ERROR and UTIL_ValidationRule.SEVERITY_WARNING constants.
Since: 1.0
Example:
String value = instance.severity;