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
amitashtekaramitashtekar 

How can I use the Standard Set Controller for a custom object.

Hello,

I want to use StandardSetController for a custom object. The user is a customer portal user. The user profile doesnot have any CRUD rights for that object(security purpose). I have created a data class with fields same as Custom object.

I want to use the StandardSetController to view the records with pagination by using data class.

 

Does anyone knows how to do it.

Best Answer chosen by Admin (Salesforce Developers) 
partha_cegpartha_ceg

you can use this code and tweak a bit to build your pagination logic.

http://salesforceblogger.blogspot.in/2012/01/build-your-own-standard-set-controller.html

All Answers

hemantgarghemantgarg

Yes , It is doable using wrapper class, in this case you will be iterating over wrappper objects on your page instead on the actual custom object records directly.

Basically you have to create a wrapper class and after your SOQL query you have to copy the custom object records into wrapper objects.

partha_cegpartha_ceg

you can use this code and tweak a bit to build your pagination logic.

http://salesforceblogger.blogspot.in/2012/01/build-your-own-standard-set-controller.html

This was selected as the best answer