apex:detail in Apex in Salesforce

apex:detail in Apex in Salesforce

Sample Code:


Visualforce page:

  1. <apex:page controller=“Sample”>  
  2.   
  3.     <apex:form >  
  4.   
  5.         <h1>Below is the Account detail</h1>  
  6.         <apex:detail subject=“{!AccountId}” relatedList=“false”/>  
  7.   
  8.     </apex:form>  
  9.   
  10. </apex:page>  



Apex Controller:

  1. public class Sample {  
  2.   
  3.     public Id AccountId {get;set;}  
  4.   
  5.     public Sample() {  
  6.   
  7.         AccountId = ‘0019000001BoVNx’;  
  8.   
  9.     }  
  10.   
  11. }  

Output:


Leave a Reply