Activity Forums Salesforce® Discussions How can we write a such apex controller class which can be used by multiple vf pages on requirement?

  • Satyakam

    Member
    July 19, 2016 at 8:46 am

    hi,

    you can use one apex controller for multiple vf pages as your requirement.you can call all functions by your vf pages using single apex controller.

    <apex:page controller="ApexController">

    you can use apex controller in every vf page as above i have written.

  • Sourabh

    Member
    July 19, 2016 at 9:07 am

    Hi Tanu,

    A single apex controller can be used for multiple VisualForce pages as per need. You just have to give the reference of the controller in your page.

    If you are using StandardController do like this:-

    <apex:page Standardcontroller="Account" extensions="ControllerName">

    If you are not using StandardController do:-

    <apex:page Standardcontroller="ControllerName">

     

    Thankyou

  • Shekhar Gadewar

    Member
    July 19, 2016 at 10:13 am

    Hi

    Sourabh,

    In last line,

    "ControllerName" is Apex class controller?

    Then will it support "StandardController" attribute?

     

    Please check once

  • Sourabh

    Member
    July 19, 2016 at 1:11 pm

    Hi Shekar,

    Actually i have written it incorrect, sorry for that.

    If you are not using StandardController do:-

    <apex:page controller=”ControllerName”>

    Thanks.

Log In to reply.

Popular Salesforce Blogs