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
Kevin DesaiKevin Desai 

StandardSetController with StandardController & Extension

Hello,

Is there a way to use StandardSetController along with Standard Controller and Extensions. Salesforce Documentation says we can. However, when I tried the attached code, the Next / Previous buttons didn't work! 


User-added image
pconpcon
What is your current page size? (you can call accountRecords.getPageSize() to see this)  Not to point out the obvious, but do you have more Opporunity records for the given account than your page size?  You can try to set the page size to something much smaller for testing if you want

//Set the number of records per page to 2
accountRecords.setPageSize(2);
Kevin DesaiKevin Desai
Well Yes, I did set the page size to make sure it shows more than one pages. Co-incidentally I set it to 2 itself :).

But the patch I did to the code was to explicitly create those two methods in my controller. Next & Previous. The code worked after that. I think SF needs to patch it in the docs as well.