Custom Error
The Custom Error activity is used with Before Save workflow and Callback workflow types. It prevents invalid records from being saved by stopping the workflow and displaying a clear error message when conditions are met. Errors can be shown either as a popup on the record page or inline on the specific field.
Considerations and Limitations
- Works only in Before Save and Callback workflows.
- Each field can show only one error message.
- Each Custom Error activity can display only one error message. Add more activities if you need more messages.
- Error messages can be up to 255 characters long.
- Some field types, like compound fields, are not supported. For example,
BillingAddressis a compound field made up of subfields such asBillingStreet,BillingCity,BillingState,BillingPostalCode, andBillingCountry. You cannot apply a Custom Error on the entire BillingAddress field; instead, point the error to a specific subfield such asBillingCityorBillingPostalCode. - Global errors (page-level messages) cannot use field values such as
Agreement.Name. - Some record types (like OpportunityTeamMember and CampaignMember) do not support custom errors when records are being deleted.
- Errors cannot run in the background (asynchronously) and cannot be reused across workflows.
Example: Workflow checks whether the agreement type is valid before saving a record. If the agreement type is MSA, the workflow continues as normal. If it is not, the Custom Error activity shows a message such as "Contract type is not valid.". This message appears to the user and is also returned in the system response, helping the user fix the problem before saving the record.
Configuration
|
Field |
Description |
|---|---|
|
Details | |
| Display Name | A simple name for the activity. |
| Reference Name | A unique identifier for the activity within the workflow. It is automatically generated from the Display Name if not specified manually. |
| Description | Optional text to explain the purpose of the activity. |
| Properties | |
| Error Type |
Specifies how the error message appears to the user.
|
| Error Message | Specify the text that appears when an error occurs. The message can be up to 255 characters long. Example: "Contract type is not valid. Please select an allowed value." Note: This field is displayed only when the Error Type is set to Popup on Record Page. You can also use variables and formulas in this field. However, formulas that depend on a context record are not supported.
|
