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
prashanth murukondaprashanth murukonda 


What are Extensions in Salesforce?
DeepthiDeepthi (Salesforce Developers) 
Hi Prashanth,

A controller extension is an Apex class that extends the functionality of a standard or custom controller. Use controller extensions when:
  • You want to leverage the built-in functionality of a standard controller but override one or more actions, such as edit, view, save, or delete.
  • You want to add new actions.
  • You want to build a Visualforce page that respects user permissions. Although a controller extension class executes in system mode, if a controller extension extends a standard controller, the logic from the standard controller does not execute in system mode. Instead, it executes in user mode, in which permissions, field-level security, and sharing rules of the current user apply.
For reference, check the below links: 

Hope this helps you!
Best Regards,
JyothsnaJyothsna (Salesforce Developers) 
Hi Prasanthi,

Extension controllers can be built to extend your controller’s functionality.

For standard controllers, extensions are required for adding new functionality.
For custom controllers, extensions aren’t necessary for new functionality, but can still be useful. Large multi-page Visualforce applications that use one custom controller can improve their controller’s modularity and readability by moving some functionality into extension controllers.

For example, if only one of your application’s pages allows users to heavily interact with an external web service, you can move all the code that supports the interaction into an extension controller that’s only used on that page. It reduces your custom controller’s size and makes a more explicit connection between your pages and functionality.

Please refer the below link for more details on Extensions.

Hope this helps you!
Best Regards,