+ Start a Discussion

any examples of embedding a VF page into the layout of a standard page?

I have a custom object and I want to embed a vf page into the layout of the custom object's standard page.  Sort of like a related list.  I've looked for examples, but can't find any.


From what I've read, the vf page has to use the standard controller of the custom object, with a custom controller extension.  I'm not sure where to go from there.


I figured it out.  I created a controller extension and set the vf page to use the object standard controller plus the custom extension.  Then, the vf page showed up in Edit Layout.


Kent ManningKent Manning

I have done this on a couple of occasions.  It is very easy to do. You just embed your visualforce page into a section of the standard page layout. You are right in that your visualforce page has to use the standard page controller or an extension to that controller. 


The problem is when you go to edit the page.  Your visualforce page component will not be presented on the edit page, so if you still want the information that is presented on the visualforce page to be seen when editing, you have to rewrite the entire edit page (not just that section) with visualforce.  Also in-line editing will not work with the visualforce "plug-in".  


The way I've approached this is to write my visualforce page in the developer mode for the page I'm trying to change.  Once I've gotten the page working as I like, I open the page layout editor on the page where I want to embed my visualforce section.  I drag a section header down and create one column. Then rather than selecting fields, I select visualforce pages, search for my page, and then drag that on to the page layout.  Once you do that you will have the option of changing the size and whether you want scroll bars or not.  You may have to play with the size in order to see everything. 


Hope that helps. 


HI guys,


I still can't figure out exactly how to achieve this...


I have been wanting to embed a simple vf page into a custom object page layout. You mentioned using a standard controller of the custom object, with a custom controller extension. Can you explain me how to do that. I’ve no programming background.


I have a custom object called Job. In this Job page I would like to click a button “scan DO”. A small VF page will appear for me to scan in a serial number. The serial number is the Jobnumber in the Job page.


Please help.