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
1) http://blog.jeffdouglas.com/2009/05/08/inline-visualforce-pages-with-standard-page-layouts/
2) http://www.cloudforce4u.com/2013/10/using-inline-visualforce-page.html

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="{!accRec.name}"/><br/>
     Account Number  <apex:outputField value="{!accRec.accountnumber}"/><br/>
     Annual Revenue     <apex:outputField value="{!accRec.annualrevenue}"/>
   </apex:pageBlock>
 </apex:form>
</apex:page>

Controller
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:pageBlock>
        <apex:pageBlockSection title="Opportunity Information">
            <apex:outputField value="{!opportunity.name}"/>
            <apex:outputField value="{!opportunity.amount}"/>
            <apex:outputField value="{!opportunity.closeDate}"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>

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 https://developer.salesforce.com/docs/atlas.en-us.196.0.workbook_vf.meta/workbook_vf/overrides_2.htm

Hope this helps you!
Best Regards,
Deepthi