Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Displaying Related Lists for Custom Objects
Displaying custom objects and their related lists with Visualforce is very simple.
Suppose you have three custom objects: MyChildObject, MyMasterObject, and MyLookupObject. MyChildObject has a master-detail relationship with MyMasterObject (which is the master). MyLookupObject also has a Lookup relationship with MyChildObject.
1<apex:page standardController="MyMasterObject__c">
2 <apex:relatedList list="MyChildObjects__r" />
3</apex:page>For this page to display the related list data, the ID of a valid custom object record with a custom relationship must be specified as a query parameter in the URL for the page, for example, http://MyDomain_login_URL/myCustomRelatedList?id=a00x00000003ij0.
1<apex:page standardController="MyLookupObject__c">
2 <apex:relatedList list="MyChildObjects__r" />
3</apex:page>