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
Click Add element (+ icon)
Select Create Records
Fill in all the details and click the Done button
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
Test
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.
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…
Fill in all the details and click the Done button
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
Test
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.
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…
0 Comments