Fault Path In Salesforce Flow

Fault Path In Salesforce Flow

 

Introduction to Salesforce Flow

  • Salesforce Flow empowers you to build complex business solutions using clicks, not code.
  • Flow Builder is the most powerful tool that a Salesforce Admin has at their disposal, giving you similar powers that Salesforce developers have.
  • If you need to perform mass updates across multiple unrelated records, or complex logic into opportunity conversion, these are common examples for when you should use Flow.
  • The use cases for Flow are endless, and its capabilities are growing with every Salesforce release.
  • Formerly Visual Flow, Salesforce Flow has gone through significant upgrades to give us the Flow Builder interface, after being completely rebuilt from the ground up.

 

What are Salesforce Flows?

  • Flows allow you to build complex business automation using clicks instead of code. As an admin, Flows are going to be your best friend because you will be able to handle the majority of complex business requirements without the help of a Salesforce developer.
  • The benefit of Salesforce Flow is that they are easy to maintain because anyone (assuming they know Flows) should be able to follow along with what you built.
  • Flows are accessible through the Setup menu. Simply enter ‘Flows’ into the Quick Find box, and create a new Flow to get started

 

What Happens When a Flow Fails?

  • When you’re deciding whether to customize the error handling in your flow, consider how a failed flow behaves.
  • When a flow fails, the user running the flow gets this error message.

An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing
the flow. Please contact your system administrator
for more information.

  • The running user can’t proceed with the flow or return to a previous part of the flow. The admin who created the flow receives a faulty email.
  • The email details the element that failed, the error message from that element, and which elements were executed during the failed interview.
  • Here’s an example error message.

An error occurred at element Delete_1.
DELETE — There is nothing in Salesforce matching your
delete criteria.

The Fault Connector :

  • Most readers have seen the ‘Unhandled Fault’ message.
  • Wonder how many of you have seen ‘Fault Connectors’ which Salesforce provides to handle Flow errors.
  • They are recommended as best practice and using them can make flows failing a lot less stressful.
  • Can use the fault connector from any of the ‘data’ elements , or the Action elements in the Flow toolbox.

How to Create a fault connector :

  • Simply create a second connection from your element after creating your first connection.
  • We now know how to create a fault connection, but what do we attach it to? Below is a simple screen flow which lets users create a Contact and Account at the same time.

 

Where did the flow fail?

  • Use an assignment element to record exactly where the flow went wrong. Assign a value to a text variable called ‘Error location’.

 

Advantage of adding Fault Path In Salesforce Flow :

  • Never see that red ‘Unhandled Fault’ message on your screen again.
  • Use a Screen element and Display Text to communicate with the user.
  • You can even add images and merge fields such as {!$Flow.FaultMessage}.
  • With this fault message, the user might even be able to see what is wrong themselves.