You are here:
Custom Error Element
Create targeted error messages in record-triggered flows to display in a window on the overall record page or as an inline error on a specific field for your users. The change that triggered the flow is rolled back until the error is fixed.
Required Editions
| View supported editions. |
You can create a custom error message only in the before-save or after-save path of a record-triggered flow. You can’t run an error message asynchronously, and the error message can’t be called from another flow type.
| FIELD | DESCRIPTION |
|---|---|
| Label | Identifies the error message on the canvas. |
| API Name | The API name must be unique within the current flow. Two elements can have the same API name if they’re used in different flows. The name can include underscores and alphanumeric characters without spaces. It must begin with a letter and can’t end with an underscore. It also can’t have two consecutive underscores. |
| Description | Describes the error message. |
| Where to Show the Error Message | Select In a window on a record page to display the error message as an overall message. Select As an inline error on a field to display the error message on the field that is causing the error. |
| Error Message | Enter text or select a resource to create an error message to display to the user when there’s an error on a record change. The error message can have up to 255 characters. You can use Translation Workbench to translate your error messages. |
Usage
Use the Custom Error element to roll back a change that triggered a flow and inform the user exactly what caused the error. The user can fix the problem and try again. For example, when a user deletes a record that triggers a flow, the flow can return an error message that tells the user why the deletion wasn’t allowed.
Considerations
- If an executed fault path has a Custom Error element, the change that triggered the flow is rolled back.
- Custom error messages use the same functionality as the addError() Id method in Apex.
- Some objects such as OpportunityTeamMember and CampaignMember don't support custom errors from record-triggered flows running before deletion. The running flow user sees an error message that explains a custom error element can’t be used when deleting these records.
- Compound fields aren’t supported.
Limits
- A Custom Error element can contain only one record page error message. To create another record page error message in the same flow, use another Custom error element.
- You can display multiple inline error messages, but only one per field.

