Activity › Forums › Salesforce® Discussions › What are the types of Controller in Salesforce Visualforce?
Tagged: Apex Class, Apex Controller, Controller Extension, Custom Controller, Field Level Security, Permissions, Salesforce Apex, Salesforce Visualforce, Sharing Rules, Standard Controller, Types of Controller
-
What are the types of Controller in Salesforce Visualforce?
Posted by Aman on September 20, 2018 at 3:01 PMWhat Are The Types Of Controller in Salesforce Visualforce?
Parul replied 7 years, 7 months ago 3 Members · 2 Replies -
2 Replies
-
Hi,
There are basically two types of Controller in Visualforce page.
1. Standard Controller
2. Custom ControllerThanks
- [adinserter block='9']
-
Adding points:
A custom controller is an Apex class that implements all of the logic for a page without leveraging a standard controller. Use custom controllers when you want your Visualforce page to run entirely in system mode, which does not enforce the permissions and field-level security of the current user.
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.
If you want your page to have the standard behaviors that are provided by Salesforce than you will be using Standard Controllers. Salesforce Provided standard controllers for most of the standard and custom objects.
Thanks
Log In to reply.