How to Use Apex:relatedList tag in Visualforce Page?
It is going to display a list of Salesforce records that are related to a parent record with a lookup or master-detail relationship.
This tag
supports following attributes.
Attribute Name
|
Description
|
||||
id
|
An identifier that allows the relatedList component to be referenced
by other components in the page.
|
||||
list
|
|
||||
pageSize
|
The number of records to display by default in the related list. If
not specified, this value defaults to 5.
|
||||
rendered
|
A Boolean value that specifies whether the component is rendered on
the page. If not specified, this value defaults to true.
|
||||
|
|
||||
title
|
The text displayed as the title of the related list. If not
specified, this value defaults to the title specified in the application.
|
Facet Name
|
Description
|
body
|
The components that appear in the body of the related list. Note that
the order in which a body facet appears in a relatedList component does not matter,
because any facet with name="body" will control the appearance of
the related list body. If specified, this facet overrides any other content
in the related list tag.
|
footer
|
The components that appear in the footer area of the related list.
Note that the order in which a footer facet appears in the body of a
relatedList component does not matter, because any facet with
name="footer" will control the appearance of the bottom of the
related list.
|
header
|
The components that appear in the header area of the related list.
Note that the order in which a header facet appears in the body of a
relatedList component does not matter, because any facet with
name="header" will control the appearance of the top of the related
list.
|
<apex:page standardController="Account">
<apex:pageBlock >
You're looking at some related lists for {!account.name}:
</apex:pageBlock>
<apex:relatedList list="Opportunities" />
<apex:relatedList list="Contacts">
<apex:facet name="header">Titles can be overriden with facets</apex:facet>
</apex:relatedList>
<apex:relatedList list="Cases" title="Or you can keep the image, but change the text" />
</apex:page>
Pass the account id as url parameter to display the related list.
For example, if 001D000000IRt53 is the account ID, the resulting URL should be:
https://Salesforce_instance/apex/myPage?id=001D000000IRt53
0 comments:
Post a Comment