function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
puli rajupuli raju 

Embed avisual force page in satandard record detail page

Amit Chaudhary 8Amit Chaudhary 8
Hi Hari,

There are to many post are available on google for same, Please check below post. I hope that will help you

An inline visualforce page is a vf page which can be embedded within a detail page of a record. Salesforce allows doing so, in the edit page layout option. A vf page would be available for embedding in the detail page layout provided page is using standard controller of that particular object. For example, in the below example a inline vf page of standard controller 'contact' would be available for embedding in contact records only.

visualforce page
<apex:page standardController="contact" extensions="inlinecontroller">
 <apex:form >
   <apex:pageBlock title="My Inline Visualforce page">
    Account Name <apex:outputField value="{!}"/><br/>
     Account Number  <apex:outputField value="{!accRec.accountnumber}"/><br/>
     Annual Revenue     <apex:outputField value="{!accRec.annualrevenue}"/>

public with sharing class inlinecontroller {
Public contact conRec{get;set;}
Public id accRecId;
Public account accRec{get;set;}
    public inlinecontroller(ApexPages.StandardController controller) {      
     accRecId = [select id,accountid from contact where id = :ApexPages.currentPage().getParameters().get('id')].accountid;
      if(accRecId != null)
         accRec = [select id,name,accountnumber,annualrevenue from account where id =:accRecId];

Let us know if this will help you
DeepthiDeepthi (Salesforce Developers) 
Hi Raju,

To be able to embed a Visual Force page into page layout, the VF page should be using the standard Controller tag referencing same entity for which this page will be used in page layout. You can use/add this visual force page by modifying the page layout. 
A simple Visual force page using the Standard Opportunity Controller.
<apex:page standardController="Opportunity" tabStyle="Opportunity">
        <apex:pageBlockSection title="Opportunity Information">
            <apex:outputField value="{!}"/>
            <apex:outputField value="{!opportunity.amount}"/>
            <apex:outputField value="{!opportunity.closeDate}"/>

After this, this page should show in Page Layout editor and can be embedded on a page layout for Opportunity. Steps on how to add visualforce page to layout are at

Hope this helps you!
Best Regards,