You need to sign in to do that
Don't have an account?
jagdish nikam 9
controller extension scenario
Hi All,
Could you please give me 2 scenario with examples which explain when should we use custom controller and controller extension?
Could you please give me 2 scenario with examples which explain when should we use custom controller and controller extension?
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.
Please refer below link for sample code.
http://www.salesforcetutorial.com/custom-controllers-controller-extensions/
Hope this helps you!
If this helps you, please mark it as solved.
Thanks and Regards
Sandhya