function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Related list link in visual force page

 i need to display   the links in visual force page  similar to the  related list links at the top of  account or any other  object standard detail page, when click on the link it should show corresponding related list exists on the same page.

Shashikant SharmaShashikant Sharma

Add a anchor tag just above the your related list



<a name="relatedListSection">&nbsp;</a>


Create a link and onclick of link 


location.href = "#relatedListSection";


This will solve your issue, please let me know if any issue in it.


Thank you sharma for the reply. As a link i used commandLink tag  when on click it is going to related list but the  page is getting refereshed which should not happen. what  i need to do for page not to refresh. 

Shashikant SharmaShashikant Sharma

Use return false like this


   function goToContactRelatedList()
       location.href = "#resSection";
       return false;
   <apex:outputLink value="Contacts" onclick="return goToContactRelatedList();"> Contacts </apex:outputLink>

 It will solve your problem of page refresh


Thank you. It worked.

Shashikant SharmaShashikant Sharma

Gr8 , Your welcome rvk . I would request you to mark it as Accepted Solution so that it can benifit others as well.