I'm working on making some JavaScript list view buttons "Lightning Ready" and am trying to find a clean way to do that. A recommended approach (somewhat counter-intuitively) is to use a Visualforce page and a controller extension of a StandardSetController
. See e.g.:
- How to convert mass actions on list view records from Classic to Lightning Experience?
- Converting JavaScript Buttons for Lightning Experience (Bayforce white paper)
I have rather a lot of these to deal with and so have asked Is there any way to pass constants from an apex:page so that the controller method invoked via its action attribute can be configured?. But behind that, the real aim is to avoid having to create a large number of separate Visualforce pages. The general solution to that overall problem is to use query string parameters, so that one Visualforce page can handle all the cases. But query string parameters can only be added for a Custom Button that has the "Content Source" option of "URL" and not "Visualforce Page".
Am I correct that for the checked Id values from the list view and the return URL to be passed to the StandardSetController
, the "Visualforce Page" option must be used so removing the opportunity of using query string parameters? Seems to be the case so far in my testing...