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
yaramareddy radhikayaramareddy radhika 

What is the difference between StandardController, Apexpages.StandardController and Apexpages.StandardSetController?

Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Radhika,
  • ApexPages.StandardController (documentation) encapsulates just a single Sobject (e.g. Account, Opportunity).
  • ApexPages.StandardSetController (documentation) contains a list of records (one or more) and has additional functions to facilitate pagination (moving between pages) and updating a number of records at once.
I hope it will be helpful.

Please mark it as best answer if resolved the issue.

Amit Chaudhary 8Amit Chaudhary 8
Please check below post for more information

StandardController Class

StandardController objects reference the pre-built Visualforce controllers provided by Salesforce. The only time it is necessary to refer to a StandardController object is when defining an extension for a standard controller. StandardController is the data type of the single argument in the
extension class constructor.
public class myControllerExtension {

    private final Account acct;
    // The extension constructor initializes the private member
    // variable acct by using the getRecord method from the standard
    // controller.
    public myControllerExtension(ApexPages.StandardController stdController) {
        this.acct = (Account)stdController.getRecord();

    public String getGreeting() {
        return 'Hello ' + + ' (' + + ')';

StandardSetController Class

StandardSetController objects allow you to create list controllers similar to, or as extensions of, the pre-built Visualforce list controllers provided by Salesforce

The StandardSetController class also contains a prototype object. This is a single sObject contained within the Visualforce StandardSetController class. If the prototype object's fields are set, those values are used during the save action, meaning that the values are applied to every record in the set controller's collection. This is useful for writing pages that perform mass updates (applying identical changes to fields within a collection of objects).
public class opportunityList2Con {
    // ApexPages.StandardSetController must be instantiated
    // for standard list controllers
    public ApexPages.StandardSetController setCon {
        get {
            if(setCon == null) {
                setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
                    [SELECT Name, CloseDate FROM Opportunity]));
            return setCon;

    // Initialize setCon and return a list of records
    public List<Opportunity> getOpportunities() {
        return (List<Opportunity>) setCon.getRecords();

Let us know if this will help you

Goku ZeusGoku Zeus
If you have a considerable amount of precious metals and want to acquire the best price, ACHATDOR.CH offers you advantageous terms.
Preston SilvaPreston Silva
Good morning! Have you ever thought about using a professional buyessay ( service for writing an essay? Professional services make it easier to get great results without spending too much time and effort. With their help, you can make sure that your essay will be high-quality and unique. Farewell!