Winter'21 - List button does not pass selected record ids to Flow and Visualforce
VisualForce , Flow , Listviews , Winter 21
Last updated 2020-10-04 ·Reference W-8120037 ·Reported By 26 users
Summary
List View Button is not passing the selected ids into the flow and Visualforce.
We can not get ids by flow, and StandardSetController.getSelected() on Visualforce also doesn't work.
Repro
This is step to reproduce using Visualforce.
1. Log into your Winter '21 org.
2. Create an Apex class and Visualforce Page using the following name and snippet:
Apex Class)
Name : AccountTestController
global class AccountTestController {
global Integer selectedCount { get; set; }
global AccountTestController(ApexPages.StandardSetController controller){
// controller.getSelected().size() will be 0
System.debug('controller.getSelected().size() : ' + controller.getSelected().size());
selectedCount = controller.getSelected().size();
}
}
Visualforce Page)
Name : AccountTestControllerVF
<apex:page id="pg" standardController="Account" extensions="AccountTestController" recordSetVar="sObjList" >
<div>selectedCount = {!selectedCount}</div>
</apex:page>
3. Go to [Setup] > [Object Manager] > [Account] > [Buttons, Links, and Actions]
4. Click [New Button or Link] button and create a Custom Button with the following settings.
Label/Name : AccountURL
Display Type : List Button
Display Checkboxes (for Multi-Record Selection) : Checked
Content Source : URL
Behavior : Display in existing window without sidebar or header
Button or Link URL : /apex/AccountTestControllerVF
5. Click [Search Layouts for Salesforce Classic]
6. Click [Edit] button in pull down option in the "List View" record.
In the [Custom Buttons] section, add the Custom Button created in the previous step to List View Search Layouts.
7. Go to [Accounts] tab.
8. Switch the List View to [All Accounts].
9. Select any records in the list and click Custom Button created in the previous step.
->"selectedCount = 0" is displayed in the next Page.
Workaround
If you are using Visualforce page, use Content Source "Visualforce Page" instead of "URL".
Reported By (26)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.