Posts

Showing posts from August, 2023

LinkedIn

Salesforce Record Triggered Flows - Create custom error messages

Image
  1. Introduction As part of Winter 24 release, Salesforce released this much-awaited flow feature by which we can fire custom error messages to users as part of record-triggered flows. This feature is available as part of both before and after save record triggered flows. We can add error messages to a specific field or at the page level. Let us see 2 use cases to demonstrate this feature. 2. Use case 1 - Before Save Flows Scenario - When an Account is getting deactivated and if there are any active Contacts under that Account, deactivation should be failed with a custom error message. Implementation steps: 1. Create an isActive checkbox in contact 2. Create a before record triggered flow in Account to check for active contacts when Account Active value becomes false: Add entry criteria as Active field update:  Now fetch active contacts under that Account: Now add a decision element to check if the count >0 if a contact exists add custom error we can see Custom Error available as a