Custom Component

Custom Component
A reusable piece of Visualforce page code that can be used in multiple different pages.

Setup >> Develop >> Components

Give component name as recordDisplay 
    <apex:attribute name="record" description="The type of record we are viewing." type="Object" required="true"/>
    <apex:pageBlock title="Viewing {!record}">  
        <apex:detail />

It can be used in any page like following

<apex:page >
  <c:recordDisplay record="Account" />
 Note: use record id in URL
Or in another page like
  <c:recordDisplay record="Contact" />
  Note: use record id in URL


Popular Posts