title: Related Lists only in salesforce
body: <p>How to get only related lists using VF or  APEX, when we pass ID and object through URL, Ex suppose I send  Account Object and ID, I should be getting only Account object related lists but not Account details. if I use APEx:Detail I will get account and it’s related lists, but I want only related lists.</p>
  
  <p>@Ivan here the code</p>
  
  <p>controller</p>
  
  <pre><code>Public Class CustomRelatedList{
  
  
  public String objectType {get; set;}
  
  public Set&lt;String&gt;  chsobject1 {get;set;}
  public sobjecttype chsobject {get;set;}
  
  public sObject[] data {get; set;}
  
  
  public CustomRelatedList() {
  chsobject1 = new Set&lt;String&gt;(); 
   }
  
  
  public void CustomRelatedList1() {
    //get URL parameters
  </code></pre>
  
  <p>//    objectType = ApexPages.currentPage().getParameters().get('urlparm');</p>
  
  <pre><code>objectType = ‘Account’; //for testing purpose will get object type &amp; Id from URL
  
  Map&lt;String , Schema.SObjectType&gt; globalDescription =     Schema.getGlobalDescribe();
  
    Schema.sObjectType sObjType = globalDescription.get(objectType);  
      Schema.DescribeSObjectResult r1 = sObjType.getDescribe(); 
  
    List&lt;Schema.ChildRelationship&gt; C = r1.getChildRelationships(); 
  
  for (Schema.ChildRelationship C1:C) {
         chsobject = C1.getChildSObject(); 
       chsobject1.add(String.valueof(chsobject));
  }
  
    }
  }
  
   VF page
  &lt;apex:page controller="CustomRelatedList" &gt;
  &lt;apex:repeat value="{!chsobject1}" var="a" &gt;
  &lt;apex:relatedList list="{!a}" subject="{!$CurrentPage.parameters.id}" /&gt; 
  &lt;/apex:repeat&gt;
  &lt;/apex:page&gt;
  </code></pre>
  
  <p>I want to display the all related List  for the Id(not just names) , but the parameter list takes only Literal</p>