1

I have a flow that can be triggered from a button on a VisualForce page and from a trigger. It basically has some logic around the opportunity line items then it submits the opportunity itself for approval. If there is an error in that "Submit for Approval" step, I want to collect it and show it to the user (if they triggered it from the VF page) or just discard it (if it was triggered from the Apex trigger).

So I built something like this to handle error from the "Submit for Approval" flow element:

Submit for approval flow element

But I am still getting these emails when the Submit for Approval fails:

Encountered unhandled fault when running process MySpecialApprovalProcess/XXXXXXX exception by user/organization: XXXXXXXX/{4}

No applicable approval process was found.



caused by element : FlowActionCall.Submit_Opportunity_For_Approval

caused by: No applicable approval process was found.

Do I need to do something else to handle that "Fault"?

This is the code that launches the flow:

Flow.Interview.MySpecialApprovalProcess flow = new Flow.Interview.MySpecialApprovalProcess(params);
flow.start();
0

Is your approval process active or functional? I imagine the flow is hitting the fault "before" it is able to process the approval action, hence the error message.

Also, despite handling all possible faults, you'll still receive an error message via email, but your end users can be presented with a message other than "An error has occurred."

Lastly, since this is a new feature, it may be most helpful to pose this to the SFDC Flow experts:

Should you want to discuss this further with our Flow Champions please visit our Official: Salesforce Workflow Automation Success Community - https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F9300000001rzc where this can be addressed further. However, just to set your expectations our Flow Champs will not configure the flow that you have but they are here to provide pointers and flow pattern which you can apply on the flow that you are designing.

  • Aah so there is no way to prevent the email error message? Well that's a bummer, I guess I'll have to take all the logic from the approval processes (the customer has a bunch of logic built-in to prevent submission in certain cases) and duplicate it into the flow then pray they don't modify it :( – Nicolas Galler May 13 '15 at 13:52
  • It would seem so. i know you can pose your question (updated comment). I would also recommend breakin down your flow to force a "fault" at a certain point to confirm something else along the way is not breaking it (perhaps your "assignment" action may be throwing the error) – James May 13 '15 at 14:26
  • Thank you for the link, I went ahead and submitted my question on there, hopefully they can provide some pointer! – Nicolas Galler May 13 '15 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.