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
Amol ChAmol Ch 

Display the list of realted record in VF page.

I'm displaying the list of account record on VF page in pageblocktable. Account record will be inline edit on Vf page. Now I've to display the list of realted contact on account record on mouseover/click, In such a way that User can quickly review(read only) the contact without scrolling up/down.
So need a contact list should be visible on mosuseover. Is it possible? or other option.

we can display the realted list of contact below to all account record but in this case user has to scroll down. This it is not satisfy my requirement.
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Amol,
 
<apex:page standardController="Account" recordSetVar="accounts" tabstyle="account" sidebar="false">
    <apex:pageBlock >
          <apex:repeat value="{!accounts}" var="a">
<apex:pageBlockSection title="{!a.name}"></apex:pageBlockSection>
  <apex:relatedList list="Contacts" subject="{!a.Id}"/>
<apex:relatedList list="Opportunities" subject="{!a.Id}" />
</apex:repeat>      
     </apex:pageBlock>
</apex:page>
Please try below code. I hope it helps

Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.

Thanks
Rahul Kumar

 
NagendraNagendra (Salesforce Developers) 
Hi Amol,

You can display the related list in a VF page using apex:relatedList tag. Following is the visual force code to display Activity History:
<apex:page standardController="Account">
    <apex:relatedList list="ActivityHistories" title="Activity History" />
</apex:page>
Below is the output:
User-added image
You can refer this link: 
Let me know if it works for you.

Kindly mark this as solved if it's resolved.

Thanks,
Nagendra
 
Amol ChAmol Ch
Hi Rahul & Nagendra,

Below is my table of all account record, displayed using PageBockTable.

Now for each account I've to show the realted contact list.  When click/Mouseover I've to dispaly realted contact

User-added image
Pankaj PPankaj P
Hi Amol,

I am assuming you need a Mini page layout to be displayed when mouse is hovered on the related Contact lookup on Account record. If this is the case you can surely do it in visual force pages.

See below given posts on how to do it.
https://www.xgeek.net/salesforce/use-salesforce-mini-page-layout-in-visualforce-page/​ (https://www.xgeek.net/salesforce/use-salesforce-mini-page-layout-in-visualforce-page/)
http://salesforceforall.blogspot.in/2012/10/displaying-minipage-layout-on-hover.html

Hope this helps you.

Thanks,
Pankaj.
Amol ChAmol Ch
@Pankaj,
Hi
I'm trying to use the minipagelayout but its only showing the information of account,

I want list of realted contact.

Please chekc my belwo screenshot.  I've check the option of contact realted list from mini pagelayout, but it is not showing on VF page.

User-added image
 
Pankaj PPankaj P
ohh okay okay.. Got it. That seems to be the custom code Amol. You need to develop such output panel with related list of Contacts and then show it as a hover popup using javascript + bootstrap.

Or it will be something like the related list links shown at top of every detail page(shown below) and when you hover you get details of few related records. But on custom VF page that too you have to develop.

User-added image
Amol ChAmol Ch
Hi Pankaj,

Thats the same I'm looking for. you have any custom code example. which will be help me lot.
Pankaj PPankaj P
Sorry Amol, Unfortunately I don't have, but I know this use case was there from some client in my acquaintance and it has to be built custom code.