Arriving in Salesforce’s Winter ‘24 release, Salesforce has shipped a new feature called Custom Error for Flow Builder that can be used to throw custom errors. This has been one of the most awaited and requested features ever since record-triggered Flows were announced.
Traditionally, to execute complex validations, Developers use Apex triggers. However, with the new Custom Error action, Admins can build complex validations and surface meaningful errors like Apex triggers.
You can also configure this action to throw multiple errors by using just one action within which you can specify numerous errors.
You’d use this feature to do data validations in your Salesforce org like you use validation rules.
But this only applies to use cases that validation rules can’t achieve. Some of them include scenarios like:
The action comes with a simple set of inputs for its configuration.
Use this input to specify the message to display to the user. You can also use Flow resources to create a more dynamic Error Message.
This radio-type input allows you to configure how you want to surface the error on the UI.
This button will enable you to add multiple errors within the same action.