Where Flows work, or come completely unstuck due to validation rules, other flows, or anything else along the line failing…

The current state (as of Summer '21) is atrocious and it has been atrocious for years.

To think that Salesforce expects that users can just get an Unhandled Exception error and no way of doing anything about it is just appalling. So I’m trying to document them as I go along and work out the best way of avoiding them if possible.

Regular Validations

Not related to Flows

Lookup Filter Validation

Validating that the lookup must be a specific record type

Validation Rule

Simple Validation on the status of a field

Before Save Flow

Field Set that invokes Validation Rule

After Save Flow

Apex Errors

And it’s not even just flows. This is an Apex trigger error. Under no circumstances should this ever be seen by the user.

There is a Duplicate rule here being hit. So why isn’t the duplicate rule error message only being displayed?

My client came back to me with this:

Hey Jodie, This record is generating an error message I've never seen before. XXX is trying to change the end date and the status to Inactive but a giant error SNAG message appears when trying to save. I'm getting the same experience.

This is what exactly the same duplicate rule looks like when editing the Contact record.

WHY can’t this or a similar error message be shown no matter HOW the error ocurred. The Apex code has the context of which record it was trying to update at that time so why can’t it just show a nice error message of “Contact Alex Jones related to this record looks like an existing record. Make sure to check any potential duplicate records before saving. View Duplicates on Alex Jones.”

This is why I generally disable ALL duplicate Alerts (I had missed this one).