Skip to main content

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:

  1. Is the Custom Error element available in both before-save (Fast Field Updates) and after-save (Actions and Related Records) record-triggered flows?
  2. Which type is recommended when the flow needs a Get Records element to look up related child records?
  3. Does a Custom Error roll back the entire save, including any other changes the user made to the record?
  4. Can the error be shown on a specific field, or only at the top of the page?
  5. Are there any limitations when the record is saved from a custom Lightning component rather than a standard record page?
5 answers
  1. Oct 20, 5:46 AM

    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,

0/9000