Posts

Showing posts from March, 2026

Salesforce Fact #987 | Skip matching records in flow create records

Image
The 'Skip the matching records' option flow Upsert operation is pretty helpful. If this option is selected, the flow first fires a SOQL to find out the matching records and if any found, skips the Create DML. This is not the case in Apex and in case of Upsert, it always fires the DML regardless of the record's existence. Attached is the screenshot.

Salesforce Fact #986 | Track first radio button select in screen flow

Image
Suppose we have a requirement to keep track of the first selected radio button in screen flow. For this, we can create an autolaunched flow and call it as a screen action. This flow will accept the first selected value and assign to a variable. We also need to set the action run condition in a way so that the subflow is called only once. In this example, we have a radio button with three values: Option1, Option2, Option3 and in the action run condition we have specified to call this flow till the currentValue resource is null. Attached are the screenshots.

Salesforce Fact #985 | Exit flow from any screen in screen flow

Image
Suppose we have a requirement to let the user exit from any of the screen in screen flow. We can use the FlowButtonBar component from UnofficialSF to implement this. However, if we want to go with the out of the box approach, here is how we can achieve it. We can create an LWC which will be embedded in each of the screens and will have an exit flow button. It will have an @api var which is set on click of confirmation from the user and sent back to the screen flow. Based on this value, we can add a decision check to find out whether user has opted to exit the flow and can route the user to the exit. Also, on confirmation from the user, we call the FlowNavigationNextEvent to proceed to the next element in the flow. One tricky thing is if the screen has outstanding validation errors then it won't move to the next screen. So, when the user opts for exiting the flow, we hide the existing inputs and then moves the user to the exit path. Attached are the screenshots.

Salesforce Fact #984 | Using < in LWC template expressions

Image
LWC now supports template expressions. However, the use of less than operator(<) has some limitations. It doesn't work in text nodes, works within expressions which are quoted as attributes. The workaround is to use the other way i.e. use the greater than or equal to operator to get the desired result. Attached are the screenshots. Reference:  https://developer.salesforce.com/docs/platform/lwc/guide/create-components-html-expressions-compatibility.html