I have a record-triggered Before Create Or Save opportunity flow. In the flow if the Stage has been changed to a certain value (Qualified) , the opportunity is checked to make sure there are contact roles. If not, then a custom Error - Missing Contact Role field is set to true. I also defined a validation rule that fires if Error - Missing Contact Role is true; the error message is something like "The opportunity is missing a contact role."
When the opportunity's stage is set to Qualified but the opportunity doesn't have a contact role, this is what the user sees:
System.DmlException: Update failed. First exception on row 0 with id XXXXXXXXXXXXX; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, The opportunity is missing a contact role.: []
This is ugly and confusing to most users. Any ideas on how to make this a more user-friendly message?
Ashish and Navneet you are totally missing my point. The error message was my example to show how not-user-friendly the message format is. I want to know how to make the message more user friendly.