Posts

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

Salesforce Fact #983 | Access stage resource in another flow

Image
Do you know we can use a stage resource in one flow which has been defined in another flow. Here is the syntax to access the stage -> namespace:flowName:stageName In the example screenshot, we are accessing the stage resource 'StageA' which has been defined in 'Mainflow1' and setting it as the current stage.

Salesforce Fact #982 | Field integrity exception while deploying a flow

We might encounter the below error while deploying a flow, which calls a subflow and accesses it's outputs: field integrity exception: unknown (the element has an invalid reference to The fix is to deploy the subflow first and then the main flow. Reference:  https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX00000Kg0LM0AZ

Salesforce Fact #981 | Issue with multi select picklist field on User object

There's an issue with accessing the multi select picklist field on user object. While accessing it for the current user in flow's formula resource it doesn't work as expected. 1) It does not appear in the search result. However if we enter it manually, the formula gets saved. 2) The INCLUDES function does not work. Always returns FALSE, even when it is expected to return TRUE. The workaround is to use a Get Records on the User object and then use a decision element with Contains operator.

Salesforce Fact #980 | Mass delete paused flow interviews

There can be multiple paused flow interviews of a flow and these paused versions do not allow to save new version of the flow. We can run a query on the FlowInterview object to fetch the paused flow interview of a particular flow and then delete those at once. The InterviewLabel field can be matched against the api name of the flow. Example query: Select Id FROM FlowInterview WHERE InterviewLabel LIKE '%<API name of flow>%' AND InterviewStatus = 'Paused' Reference:  https://help.salesforce.com/s/articleView?id=000388016&type=1

Salesforce Fact #979 | Choice resource quick create in screen flow

Image
While setting choice resource in radio button or picklist input in screen flow, we can make use of the quick create feature. In the choice input, we can simply enter the name of the choice and select the 'Create Choice' option. In the backend , it will create a choice resource with the entered value. Attached are the screenshots.