Ad Code

How to add fault path in salesforce record triggered flow

Fault path in the salesforce record triggered flow

In this blog post, we'll discuss how to add a fault path in the Salesforce Record-Triggered Lightning Flow.

We have a simple flow that gets triggered when the Case status is updated to Closed. Let us incorporate a fault path for the Apex action in this record-triggered flow

Salesforce record triggered flow

Click on Apex Action (1) and click Add Fault Path (2)

Apex action in the record triggered flow

A fault path is added to the flow

Apex action in the record triggered flow

Click Add element (+ icon)

Apex action in the record triggered flow

Select Create Records

Add fault path in the flow

Fill in all the details and click the Done button

Fault path error log creation

The error log mentioned in the above screenshot is a custom object which is created for error logging.

Save the flow changes and activate the latest version

Salesforce record triggered lightning flow


As per the above implementation, when there is any exception in the apex action, the fault path is executed and the new record is inserted into the Custom Error Log table.

Salesforce developer console

The fault path enables us to handle any potential exceptions that may occur during the execution of the functionality in the respective node and it also avoids displaying the system-generated errors to the user interface.

Hence it is always recommended to add a fault path to the apex actions, DML operations, and any other important nodes of the flow.

If you have any questions or comments, please leave them in the comments section below.

Until then…

Post a Comment