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.
<apex:page standardController="MyMasterObject__c"> <apex:relatedList list="MyChildObjects__r" /> </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://na3.salesforce.com/myCustomRelatedList?id=a00x00000003ij0.
<apex:page standardController="MyLookupObject__c"> <apex:relatedList list="MyChildObjects__r" /> </apex:page>