3

I have a VF page containing a flow. The VF page uses a Standard List Controller pass a list of records (Contacts) to the flow. I've added a List Button and added it to the List layout, and this works. But I need to change the end of flow behavior. According to the docs, you can specify a finishLocation on the flow in VF to specify where the User ends up after the flow.

The client would like to send the user back to the original list view (whichever view was selected) after the flow. Is this possible? I added a controller extension to check the referer header (ApexPages.currentPage().getHeaders().get('Referer')), but that is only returning a base URL (e.g., https://force-drive-3563.lightning.force.com/) in LEX. Just redirecting to the LEX generic list view url (/lightning/o/Contact/list) without specifying filterName always displays "recently viewed" contacts. Is there any way to determine the originating view and to send the user back to it after the flow?

1 Answer 1

2

I haven't tried this but theoretically looking at the documentation looks like you could achieve what your'e looking for Using Standard List Controller Actions

list : Returns a PageReference object of the standard list page, based on the most recently used list filter for that object when the filterId is not specified by the user.

For reference: The CORRECT way to redirect to a ListView from StandardSetController?

2
  • using getUrl() on the page ref gives me a classic-style url (e.g., /003?fcf=00BZ0000001mOo8) to feed to finishLocation, but LEX redirects to the correct place. In my testing it's always returning the correct 'last-used list view'. Oct 16, 2018 at 11:37
  • @JasonClark that's good to know. Like I said I never tried its by looking documentation I figured it out Oct 16, 2018 at 11:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .