---
schema_version: "1"
id: 1974ea73ea6c83debb3e92214856e85dbf3a0289875fe1c921f27523114a4a36
title: Custom Error Element
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_ref_elements_custom_error.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_custom_error.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ae1ef2327b309364fd40e4188db59b58f1534999c40b17f6741c39a056d4a878
description: 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.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# 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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr></tbody></table>

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 a run 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.

#### See Also

- [_Salesforce Developers_: Apex Reference Guide](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_id.htm?_ga=2.201080110.1837804536.1690896507-579833793.1688039438#apex_System_Id_addError)