You need to sign in to do that
Don't have an account?
Theodoor van Donge 8
We have made a custom Visualforce:
This is connected to a custom button which is part of a listview. If we select records in the listview they are correctly displayed in the visualforce page. But when we deselect records they are still visibile in the visualforce.
Use custom list view button, keeps remembering deselected records
We have made a custom Visualforce:
<apex:page id="CloseCases" standardController="Case" recordSetVar="cases"> <apex:repeat value="{!cases}" var="case"> {!case.CaseNumber} <br/> </apex:repeat> </apex:page>
This is connected to a custom button which is part of a listview. If we select records in the listview they are correctly displayed in the visualforce page. But when we deselect records they are still visibile in the visualforce.
It works like this; the Visualforce page needs to be modified like this:
And you need a additional extension:
So the takeway for all of this: the recordSetVar does contain the whole listview, not only the selected records.
All Answers
This is happening because you are not removing those records from your 'cases' collection. You will need to remove the deselected records from your collection. Add the records if they are selected and remove the records if the are deselected.
Hope this helps!
Thanks for replying! Well, the deselection is not something i have build, but just happens in the standard listview.
So to reproduce it would be like:
This is all done in Lightning btw.
It works like this; the Visualforce page needs to be modified like this:
And you need a additional extension:
So the takeway for all of this: the recordSetVar does contain the whole listview, not only the selected records.