Activity Forums Salesforce® Discussions Is it possible to create a reusable inline Salesforce Visualforce page?

  • Abhinav

    Member
    May 27, 2016 at 1:14 pm

    Hi Ravi,

    You don't have to create a separate apex controller for each VF page, but you do need 1 VF page per standard controller you need to "extend".

    What we generally do is that create 1 controller class that uses generic SObject methods to manipulate its data. That controller has a method, getCtl(), which returns itself. It generify the VF content into a custom component which takes the single controller class as an argument. Then I create multiple VF pages with just a one-liner to that component, for e.g

    <apex:page showHeader=”false” sidebar=”false” standardController=”Account” extensions=”MyGenericController”>
    <c:MyCommonVfComponent ctl=”{!ctl}” />
    </apex:page>
  • Avnish Yadav

    Member
    September 30, 2018 at 4:38 am

    Hello,

    You can implement a VF page and as long as it shares the standard controller of the object whose page layout your trying to add it too, it's available to be added to that page in the standard page-layout controller.
    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos