apex:detail in Apex in Salesforce

Sample Code:

Visualforce page:

<apex:page controller="Sample">
    <apex:form >
        <h1>Below is the Account detail</h1>
        <apex:detail subject="{!AccountId}" relatedList="false"/>
    </apex:form>

</apex:page>

Apex Controller:

public class Sample {
    public Id AccountId {get;set;}
 
    public Sample() {
        AccountId = '0019000001BoVNx';
    }
}

Output:



Cheers!!!

No comments:

Post a Comment