Not surprisingly, there are tons of articles and videos about how to invoke a screen flow from a custom button on a list view. What is surprising is how nearly all of them are incomplete.

To bring you up to speed, to invoke a screen flow from a list view, you need to create a list button instead of an action. For the list button URL, you set the flow’s URL. e.g. “/flow/My_Cool_Flow”. Most likely, you’ll also want to set Display Checkboxes (for Multi-Record Selection) to True.

Instead of a popup, the flow executes in a full screen window. At the end of the flow, clicking the “Finish” button doesn’t do anything.

The documentation says you can add the parameter retURL to the button URL (e.g. “/flow/My_Cool_Flow&retURL=001/o”), but that doesn’t actually work if you’ve selected multiple records. You’re stuck in the flow forever.

So let’s discuss options to resolve this issue.

Option 1: Use a LWC
You can wrap a LWC around a screen flow and then invoke the LWC from the button. However this requires apex development and I’m not sure how to pass multiple records Ids to the LWC. (If you know how, please let me know)

Option 2: Use a 3rd party tool
Unofficial SF has a flow action called “Navigate Everywhere”. I haven’t tried it myself, but the downside is it requires depence on this unofficial function.

Option 3: Use some admin creativity
Using as much administrative and out-of-the-box ingenuity as possible, you can

  1. Hide the flow footer on all final screens
  2. Create a text template resource with the following:
    1. <p style="border-top: 1px solid #C9C9C9; padding: 10px 10px 5px 10px; text-align: right;"><a href="/lightning/o/{Object}/list" rel="noopener noreferrer" target="_self"><img src="{image URL}" alt="Finish"></a></p>
    2. where {Object} is the object’s API name and {image URL} is an externally available image containing a button with the label “Finish”
  3. Insert the text template at the bottom of all final screens.

The result looks like this, which is nearly identical to how it looks if it was in a popup window.

Note: One consideration is you cannot return to the original list view. You can only return to a publicly available one.

The takeaway
Even when working on functionality that touches the limits of Salesforce, stay as native as possible.

This reduces development costs, and if/when Salesforce resolves this issue, you won’t need to update much.

Category:
Salesforce