function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
V AnandV Anand 

how to get all the record ids of listview?

Hi

 

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

hitesh90hitesh90

Hi,

 

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:pageBlock>
        <apex:pageBlockTable value="{!accounts}" var="a" >
            <apex:column value="{!a.Id}"/>
            <apex:column value="{!a.name}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

 Controller:

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}