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
westjohnwestjohn 

StandardSetController PageSize

Can We change the StandardSetController PageSize?

In Normally PageSize per page is 2000(Default)..

Can we change pagesize from to 2000 to 3000?

Alok_NagarroAlok_Nagarro

Hi,

 

yes, there is a instance method of StandardSetController class, that you can use to set the size of record set per page.

 

void setPageSize(Integer pageSize)

AdrianCCAdrianCC

Howdy,

 

I don't know if you can modify it from 2000, but there is a setPageSize() in the documentation. Give it a try and see if it works...

Link: http://www.salesforce.com/us/developer/docs/pages/Content/apex_pages_standardsetcontroller.htm

 

Thanks,

Adrian

westjohnwestjohn

I used setPageSize in My Apex class....

 

My code is

 

Accounts = new ApexPages.StandardSetController(Database.getQueryLocator([ SELECT Id,
Rank__c,Name

FROM Account
]));
Accounts.setPageSize(2000);
AccountList = (List<Account>)Accounts.getRecords();

 

I changed Page size to 3000

i.e Accounts.setPageSize(3000);

I got the following error

 

INVALID_BATCH_SIZE: invalid batch size: 3000 

 

Any possible to change the value?

westjohnwestjohn

I used setPageSize in My Apex class....

 

My code is

 

Accounts = new ApexPages.StandardSetController(Database.getQueryLocator([ SELECT Id, 
Rank__c,Name

FROM Account 
])); 
Accounts.setPageSize(2000);
AccountList = (List<Account>)Accounts.getRecords();

 

I changed Page size to 3000

i.e Accounts.setPageSize(3000);

I got the following error

 

INVALID_BATCH_SIZE: invalid batch size: 3000 

 

Any possible to change the value?

Alok_NagarroAlok_Nagarro

 

-

 

 

2,000 is the maximun value...