You need to sign in to do that
Don't have an account?
nagalakshmi
How to display the Records more than 1000 in visual force page using select options
Hi,
How to display the records more than 1000 using visual force page select options. I am getting the error as
Collection size 1,829 exceeds maximum size of 1,000. How to solve this error. Please help me.
Thanks,
Lakshmi.
you can use standarad set controller or u can use nested list to display more than 1000...
i hav displayed all 1000 records in a vf page ...i think dis may b useful
vf page:
<apex:page sidebar="false" standardController="Department__c" recordSetVar="records" extensions="PageDataClass">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:pageBlockTable value="{!records}" var="r">
<apex:column headerValue="Name">
{!r.Name}
</apex:column>
</apex:pageBlockTable>
</apex:pageBlockSection>
<apex:commandLink value="previous" action="{!previous}"/> |
<apex:commandLink value="next" action="{!next}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
controller:
public with sharing class PageDataClass {
public PageDataClass(ApexPages.StandardSetController controller) {
controller.setpagesize(1000);
}
}
Regards,
ram.
==================================
Hi,
Thanks for your reply. But i am using the select options. How can i achieve this.
Hi,
Can you provide the sample code. Thanks in advance.
Thanks,
Lakshmi.
i think this is ur requirement....................
<apex:page sidebar="false" controller="accPickNamesDisplayClass">
<apex:form >
<apex:selectList multiselect="false" size="1">
<apex:selectOptions value="{!accNames}">
</apex:selectOptions>
</apex:selectList>
</apex:form>
</apex:page>
controller:
public with sharing class accPickNamesDisplayClass {
List<selectOption> options = new List<selectOption>();
public List<selectOption> getAccNames() {
for(account acc : [select Id,name from account])
{
options.add(new selectOption(acc.name,acc.name));
}
return options;
}
}
====================================================
If you want to display more than 1000 record in select list then am sorry it is not possible as this is a limitation of salesforce.
Thanks
Ankit Arora
Blog | Facebook | Blog Page