+ Start a Discussion
V AnandV Anand 

how to get all the record ids of listview?



Listview contains group of records as per filter criteria. Now I want to crate a visualforce page in that first selet the list view based on the list vew all  records of that list view will be updated.


simply , update the records based on the list view selection.

any one suggest me how to retrieve  record ids of list view in apex




You have to put <apex:inputcheckbox/> tag in your Visualforce page.
and get selected ids in one string(use <apex:inputHidden value="{!strSelectedIds}"/> tag) variable using javascript.


Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.

Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator
My Blog:- http://mrjavascript.blogspot.in/

Dhaval PanchalDhaval Panchal

See below example.


VF Page:

<apex:page standardController="Account" recordSetVar="accounts" extensions="recordSetVarController">
        <apex:pageBlockTable value="{!accounts}" var="a" >
            <apex:column value="{!a.Id}"/>
            <apex:column value="{!a.name}"/>


public class recordSetVarController {
    public List<Account> obj{get;set;}
    public recordSetVarController(ApexPages.StandardSetController controller) {
        obj = (List<Account>) controller.getSelected();

 Here obj has all relected ids. And once you execute controller.getSelected() in vf page you will get only selected records using {!accounts}