FLOW_ClearValidationBypass
Class · Group: Validation
global inherited sharing class FLOW_ClearValidationBypassFlow invocable action to clear validation rule bypasses for the current transaction. Use this after DML operations in Flow to explicitly clear bypasses set by FLOW_BypassValidation. Important: While bypasses are automatically cleared at the end of the transaction, explicitly clearing them after DML improves code clarity and prevents accidental bypass of subsequent validation in the same transaction.
Since: 1.0
Example:
// Flow Configuration - Clear specific bypass: Action: Clear Validation Bypass Input: Name: Account // Flow Configuration - Clear all bypasses: Action: Clear Validation Bypass Input: ClearAll: true
See Also: UTIL_ValidationRule, FLOW_BypassValidation
Methods
| Method | Description |
|---|---|
| global static void clearBypass(List<FLOW_ClearValidationBypass.DTO_Request> requests) | Clears validation rule bypasses for the current transaction. |
Inner Classes
| Class | Description |
|---|---|
| DTO_Request | Request DTO for the Clear Validation Bypass invocable action. |
Method Details
clearBypass
@InvocableMethod(category='Validation' description='Clears validation rule bypasses for an object, group, or specific rule for the current transaction.' label='Clear Validation Bypass') global static void clearBypass(List<FLOW_ClearValidationBypass.DTO_Request> requests)Clears validation rule bypasses for the current transaction. If clearAll is true, all active bypasses are removed. Otherwise, the specified name is removed from all bypass lists (object, group, and rule).
Parameters:
requests(List) - List of clear bypass requests
Since: 1.0
Example:
// Clear Account bypass
FLOW_ClearValidationBypass.DTO_Request request = new FLOW_ClearValidationBypass.DTO_Request();
request.name = 'Account';
FLOW_ClearValidationBypass.clearBypass(new List<FLOW_ClearValidationBypass.DTO_Request>{request});