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
imam sahebimam saheb 

how to use and which scenario we record set var=""

how to use and which scenario we  record set var=""
Amit Chaudhary 8Amit Chaudhary 8
recordSetVar attribute in Visual force page:
  This attribute indicates that VF page uses set oriented standard controller. The value of the attribute indicates name of the set of records passed to the page means collection records. This record set can be used in the expressions to return values for display on the page or to perform actions on set of records.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_page.htm
   
For example given below VF page, if your page is using the standard accounts controller, and recordSetVar is set to "accounts", you could create a simple pageBlockTable of account records by doing the following:
<apex:pageBlockTable   value="{!accounts}" var="a">
<apex:column value="{!a.name}"/>
</apex:pageBlockTable>

VF Page:
<apex:page standardController="Account" recordSetVar="accounts">
 <apex:dataList var="a" value="{!accounts}" type="1">
     {!a.name}
    </apex:dataList>
    </apex:page>
            Above displays all account with number.

Associating a Standard List Controller with a Visualforce Page
Using a standard list controller is very similar to using a standard controller. First you set the standardController attribute on the <apex:page> component, then you set the recordSetVar attribute on the same component.
For example, to associate a page with the standard list controller for accounts, use the following markup:
<apex:page standardController="Account" recordSetVar="accounts">


1) https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_sosc_associate.htm
 
<apex:page standardController="Account" recordSetVar="accounts">
<apex:form >
<apex:pageBlock >

    <apex:pageBlockTable value="{!accounts}" var="a" >
        <apex:column value="{!a.Id}"/>
        <apex:column value="{!a.name}"/>
    </apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

Let us know if this will help you
 
imam sahebimam saheb
Yah Greate ...Thanq