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
Kishore Vamsi 6Kishore Vamsi 6 

How to display more than 1000 values in picklist using select option

I want to display more than 1000 account names in one picklist using select option.

<apex:selectList value="{!myAccountspicklist}" >
<apex:selectOptions value="{!myaccounts}"/>
  </apex:selectList>

public List<Account> getMyaccounts(){
        List<Account> lstAccount = [select id,name from account];
        return lstAccount;
    }
Raquib SFRaquib SF
Hi Kishore,

For reference : https://developer.salesforce.com/forums/?id=906F0000000MMUfIAO

Although, I must ask - why do you want to display 1000 values in a picklist?

Thanks!
Kishore Vamsi 6Kishore Vamsi 6
I want to display more than 1000 account name in one picklist field using selectOption. Earlyer I am able to display 20 name using above code but after inserting more than 1k it is throwing error.