Skip to content

FLOW_BypassValidation

Class · Group: Validation

apex
global inherited sharing class FLOW_BypassValidation

Flow invocable action to bypass validation rules for the current transaction. Use this before DML operations in Flow to temporarily disable validation rules. Important: Bypasses are cleared at the end of the transaction. Use FLOW_ClearValidationBypass after your DML to explicitly clear bypasses for clarity.

Example

// Flow Configuration: Action: Bypass Validation Input: BypassType: OBJECT_NAME (or GROUP_NAME or RULE_NAME) Name: Account // Perform DML... Action: Clear Validation Bypass Input: Name: Account

See Also: UTIL_ValidationRule, FLOW_ExecuteValidationRules, FLOW_ClearValidationBypass


Methods

MethodDescription
global static void bypass(List<FLOW_BypassValidation.DTO_Request> requests)Sets a validation bypass for the current transaction.

bypass

apex
@InvocableMethod(category='Validation' description='Bypasses validation rules for an object, group, or specific rule for the current transaction.' label='Bypass Validation') global static void bypass(List<FLOW_BypassValidation.DTO_Request> requests)

Sets a validation bypass for the current transaction.

Parameters

ParameterTypeDescription
requestsListList of bypass requests

Throws

ExceptionDescription
System.NoSuchElementExceptionif an invalid bypass type is provided (with a user-friendly message)

Example

apex
// Bypass all Account validation rules
FLOW_BypassValidation.DTO_Request request = new FLOW_BypassValidation.DTO_Request();
request.bypassType = 'OBJECT_NAME';
request.name = 'Account';
FLOW_BypassValidation.bypass(new List<FLOW_BypassValidation.DTO_Request>{request});

Inner Classes

ClassDescription
DTO_RequestRequest DTO for the Bypass Validation invocable action.