Activity Forums Salesforce® Discussions How many custom controllers can we have per Visualforce page in Salesforce?

  • Manish

    Member
    January 18, 2020 at 8:12 am

    Hi Deepak,

    We have three types of controllers that we use on Visualforce Page,

    1. Standard Controller : Standard controllers will have same logic and functionality used standard visualforce pages. No Apex code is required in Standard Controllers

    Syntax: <apex:page standardController="Account">

    2. Custom Controller : When a developer needs different logic and functionality he/she may write their own Apex      controller class. Custom controller’s will not provide default functions like standard controllers.

    Syntax : <apex:page controller="ClassName">

    3. Extensions : If we want to use both custom controller functionality and standard controller functionality we use               extension controllers. Extension Controllers begins with Standard controller and extended or overridden with custom   controller with custom apex code.

    Syntax: <apex:page standardController="Äccount" extensions="ClassName, ClassName2">

  • Shweta

    Member
    January 20, 2020 at 2:14 pm

    We can have only one controller at a time either it may be Standard Controller or Custom Controller and multiple controller extensions. There is no limit on the number of extensions you can have on a VisualForce.

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos