+ 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