Plat-Dev-201 practice question 4 of 30
Universal Containers has a Visualforce page that displays a table of every Container__c being rented by a given Account. Recently this page is failing with a view state limit because some of the customers rent over 10,000 containers. What should a developer change about the Visualforce page to help with the page load errors?
Full set: 204 questionsThe StandardSetController is a built-in Visualforce controller that is specifically designed to manage sets of records. It provides out-of-the-box functionality for pagination, such as next(), previous(), first(), and last() methods. By using a StandardSetController, the page will only load one page of records at a time into the view state, effectively resolving the "view state limit" error when dealing with thousands of records. This is the most direct and standard solution for this common Visualforce problem.
A. OffsetController is not a standard Salesforce class. While pagination is the correct approach, this is not the correct implementation class name.
C. JavaScript remoting avoids view state entirely but requires significant client-side code to build the table and manage state, making it more complex than the standard server-side solution.
D. A transient list variable is not stored in the view state, but it becomes null on postback, requiring it to be re-queried. It doesn't solve pagination on its own.
Salesforce Apex Developer Guide, "Using Standard Set Controllers," Section: "StandardSetController Class." This section details how StandardSetController enables pagination for displaying large record sets.
Salesforce Visualforce Developer Guide, "Best Practices for Improving Visualforce Performance," Section: "Minimize View State." This guide explicitly recommends using StandardSetController for pagination to manage large data volumes.
Keep practicing
Take the free Plat-Dev-201 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other Plat-Dev-201 practice questions
- Question 1Which three steps allow a custom Scalable Vector Graphic (SVG) to be included in a Lightn…
- Question 2Which two statements are true about using the @testSetup annotation in an Apex test class…
- Question 3Managers at Universal Containers want to ensure that only decommissioned containers are a…
- Question 5A developer is alerted to an issue with a custom Apex trigger that is causing records to …
- Question 6Which two operations affect the number of times a trigger can fire? Choose 2 answers
- Question 7A team of developers is working on a source-driven project that allows them to work indep…
