Salesforce Certified Platform Developer II — Question 55
A developer must create a custom pagination solution. While users navigate through pages, if the data is changed from elsewhere, users should still see the cached results first accessed.
How can the developer meet these requirements?
Answer options
- A. Use @Cache annotation
- B. Use a StandardSetController
- C. Use OFFSET in SOQL queries
- D. Use OFFSET WITH CACHE in SOQL queries
Correct answer: B
Explanation
The correct approach is to use a StandardSetController, which allows for managing pagination while maintaining the integrity of the initial dataset seen by users. The other options do not provide the necessary functionality for caching the initial results as effectively as a StandardSetController does.