Blog

02/10/2023

Winter 24- custom error message using Record Triggered Flow

Quite a buzz going around in the Salesforce ecosystem about the Winter-24 release features especially related to lightning flow. So let’s discuss one of the features i.e. Display custom error messages using Record Triggered flow.

Use Case :-

Universal Containers has implemented CPQ & they are heavily using Quote Line Groups so that the Sales Rep can categorise the quote lines based upon the family of products like software, hardware or support products. Dates play a crucial role while doing the quotation in CPQ, so the business came up with a requirement, i.e. Quote Line Group Start Date & End Date should lie in between the Quote’s Start Date & End Date.

Implementation

One can choose either Apex Trigger or Record Triggered Flow to implement the solution, but one of the developers decided to use Record Triggered Flow using the Custom Error Element introduced by Salesforce in the Winter-24 release.

  1. Setup -> Quick Find -> Flows

ex-p_PLslAAbyTJj2Nlh0Y7kmd7wFBSB7w6Gi50ZDTjd9js6yh0oFvXM061CPkoDYrCz-S0kr4R49sNd7tpNgsuc6Io9od6_jzwHFJhP-Dv5YfcxTlB6XX6oepgUJTnBHAB4QsPyqniQt9IItCrOur0.png

Navigate To Flows

2. Click on New Flow -> Choose Record Triggered Flow -> Create

0wR5TxJmwnT1fclvVWE_kJtvRWFwQFsagUn1MHokKNgubAKWGwXesH-Pwg6iWtRRdOf9metJ6HtgMDNL0aQED2QIbBZWAriD0XO5d7pHk-7yfxkpuTz6E8w8eRyWS5HLYdFQXE0dmCZf_MqfmklARa4.png

New Flow

V7UvYL7H1ARnUjg2eGJDjAxRuSk9BAi2E4ZHcySEOpRlbk4vWJovMKgLeNmhwaVERu3MaZbPEUI4IQ_DyKDIjEVW5LUpw7JvCo8E1M-RgXM-y5fj5bJcNBIZXx6MCgZ70HgyGcfY3mox4z0mLfjEh8g.png

Record-Triggered Flow

Note: Custom Error Element is only available in Record Triggered Flows.

3. Configure the Start Element as shown below:-

JgbxHaOeActpnDNcGFSmRzkRNnOiQMPt_RuldfXsKh4N9Plxvi5_RmWYftql0nkcRqtQ3Ij7SEp6VyEObYBpwRZYh3ywXAsoh9BebygUdXnh-RwrhxZhge7y00jQrAtK3_k3OQUADDOsE8g4CJI5VGM.png

4. Use the Decision Box Element to compare the Quote line Group dates with Quote Dates.