One of top feature of Salesforce Winter 24 Release is now you can create a Custom Error Messages for Record Triggered Flows. Finally Salesforce implemented the Allow customization of error messages for record-triggered flows idea from IdeaExchange.
What is Custom Error Messages Element?
Custom Error Messages Element let you create error message for your end to show on Salesforce Flow. The associated record change is rolled back. Error messages can be created for before-save and after-save flows.
When to use custom Error Message?
Best use case of using custom error messages element is for doing any DML on a Record Triggered Flows and show customize message to end user. Before this when flow failed there was not possible to show user friendly message to end user. Now with this you can display a specific error message.
How to Display Custom Message in Flow
Follow below step by step process to add the custom error component in flow.
1. Add Custom Error Message Element
First thing first you need to add custom error message element in your flow.
2. Choose Where to display the error message
Then you need to select where you want to show error message. There are two option is “In a window on a record page” or “As an inline error on a field”.
3. Enter the error message
Then enter the error message in Error Message box.
To handle then unexpected error you can use fault Path to add Error Message.
I’m excited to hear about the new feature in the Salesforce Winter 24 Release that allows us to create custom error messages for Record Triggered Flows. This is a significant step forward and a feature that many Salesforce admins and developers have been eagerly waiting for.
Hi,
I have used Custom Error component in create/update record-triggered flow and the component is giving me an error during build validation.
‘duplicate value found: ‘.
The api version of the flow is 56. Do you happen to know if there are things I need to consider when using this flow element?
Thank you.
Hi,
I have used the Custom Error element on my record-triggered flow and I got an error during build validation. ‘duplicate value found: ‘. The api version of the flow is 56. Do you happen to know if there are things I need to consider when using this flow element?
Thank you.
I used this custom error component, but when we are trying to build the package, getting error as ‘Invalid element reference not found for target’
This is resolved by upgrading sourceapiversion to 59. Thank you
We were able to solve the issue by changing the api version if sfdz-proj.json file to 59
Thanks for sharing this insightful post about the new Custom Error Messages feature in Salesforce Winter 24 Release. It’s excellent that Salesforce has implemented the idea from IdeaExchange, allowing users to customize error messages for record-triggered flows.