2 answers
Hi KMForce,Thank you for the update. I figured that out previously, but unfortunately I didn't get the desired result, so I've somewhat given up on the task in order to focus on others.I have a process that runs when certain fields are changed on an opportunity. This process then calls a flow that makes more intricate decisions based on other fields on the opportunity. There are a few situations where a workflow rule prevents the record from being saved and I get the "Unhandled Error" from SF. I'd rather throw a detailed error so I put the above apex class into the flow at the point of the "error" rather than having the flow try to update the record with the current values. The "InvocableMethod" part allows me to pass values from the flow into the apex class, but unfortunately it doesn't produce an error message on the opportunity.Thinking about it now I might be able to get to the end result that I want by updating a particular field with the error message during the flow and then have a trigger run, if that field is populated, that displays the information the field. Sadly, I've been given several other projects so this has been put on the backburner, but I'd like to find a solution since this is a pretty common problem that hasn't been addressed yet by SF.Thanks for your help,Best regards,Justin