Activity Forums Salesforce® Discussions What is the use of apex:detail component in Salesforce?

  • Prachi

    Member
    August 9, 2018 at 9:03 am

    Hello Avnish,

    The standard detail page for a particular object, as defined by the associated page layout for the object in Setup. This component includes attributes for including or excluding the associated related lists, related list hover links, and title bar that appear in the standard Salesforce application interface.

    Thanks.

  • Avnish Yadav

    Member
    August 9, 2018 at 9:04 am

    Thanks.

  • shariq

    Member
    September 16, 2018 at 5:39 pm

    Hi,

    To understand it more here is the example -

    <!-- For this example to render properly, you must associate the Visualforce page
    with a valid account record in the URL.
    For example, if 001D000000IRt53 is the account ID, the resulting URL should be:
    https://Salesforce_instance/apex/myPage?id=001D000000IRt53
    See the Visualforce Developer's Guide Quick Start Tutorial for more information. -->

    <apex:page standardController="Account">
    <apex:detail subject="{!account.ownerId}" relatedList="false" title="false"/>
    </apex:page>

    Hope this helps.

  • Parul

    Member
    September 17, 2018 at 6:25 am

    Hi

    <apex:detail>:
    The standard detail page for a particular object, as defined by the associated page layout for the object in Setup. This component includes attributes for including or excluding the associated related lists, related list hover links, and title bar that appear in the standard Salesforce application interface.

    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';
    }
    }

    thanks

Log In to reply.

Popular Salesforce Blogs