In a record-triggered flow on a custom object, can I use the Custom Error element to stop a record from saving and show an error message to the user, similar to a validation rule?
My scenario: on the Loan object, when a checkbox field changes from false to true, I want the flow to check whether at least one related child record exists (the child has a lookup field to the Loan). If no child record exists, the save should be blocked with an error message.
Please confirm:
- Is the Custom Error element available in both before-save (Fast Field Updates) and after-save (Actions and Related Records) record-triggered flows?
- Which type is recommended when the flow needs a Get Records element to look up related child records?
- Does a Custom Error roll back the entire save, including any other changes the user made to the record?
- Can the error be shown on a specific field, or only at the top of the page?
- Are there any limitations when the record is saved from a custom Lightning component rather than a standard record page?
Yes, you can absolutely use the custom error element in an after-save record-triggered flow .
Because your specific scenario requires a Get Records element to query related child records, you must run this logic on the after-save path (Actions and Related Records), as before-save flows do not support database queries. When triggered, the Custom Error completely rolls back the transaction,