+ Start a Discussion
geetageeta 

Building custom related list using VisualForce

Hi,
 
I am trying to build a custom related list on the Account detail page which basically merges the data from two relationships and displays in this one related list. However, I have some UI rendering issues.
 
1. The border on the custom related list appears thicker than the standard related list. Can we control this behaviour?
2. Since I am adding the related list below the Account detail section, I see the 'Back to Top' and 'Always show me more records per related list' links between the detail section and the custom related list. Is there a way to hide these links or move them to the bottom of the page?
3. If I set the relatedList attribute on apex:detail to false and selectively add the related lists, then the issue I stated above in #2 is solved, but I lose the Related List hovers on top of the page. Is there a way to add these hovers?
 
Appreciate your help.
 
Code:
<apex:page standardController="Account" extensions="myControllerExtension">      
    <apex:detail relatedList="true" >
    <!--apex:relatedList list="Contacts" subject="{!account}"></apex:relatedList>
    <apex:relatedList list="ActivityHistories" subject="{!account}"></apex:relatedList>
    <apex:relatedList list="NotesAndAttachments" subject="{!account}"></apex:relatedList -->

    <apex:pageBlock title="Related Firms"  helpTitle="Related Firms Help" helpUrl="">
        <apex:pageBlockButtons location="top">
           <apex:form ><apex:commandButton action="{!createNewRelationship}" value="New" /></apex:form>
        </apex:pageBlockButtons>
        <apex:variable var="baseId" value="{!Url}" />       
        
        <apex:pageBlockTable value="{!RelatedFirms}" var="item">
            <apex:column headerValue="Action"> <apex:outputLink value="/{!item.id}/e—retURL=%2F{!baseId}" id="editLink"><b>Edit</b></apex:outputLink> | <apex:outputLink value="/setup/own/deleteredirect.jsp–delID={!item.id}&retURL=%2F{!baseId}" id="delLink"><b>Del</b></apex:outputLink></apex:column>
            <apex:column headerValue="Related Firm"> <apex:outputLink value="/{!item.id}">{!item.name}</apex:outputLink> </apex:column> 
            <apex:column headerValue="Relationship Type"> &nbsp; </apex:column>
        </apex:pageBlockTable> 

    </apex:pageBlock>
    </apex:detail>
</apex:page>

 
MyGodItsColdMyGodItsCold
Did you get the extensions to work with the StandardController? I tried that & it wouldn't save it.

See http://community.salesforce.com/sforce/board/message?board.id=general_development&thread.id=19561

I'm trying to filter a related list.
geetageeta
Yes, extensions work with the standardController. Are you still having issues, post the code and I can take a look at it.
MyGodItsColdMyGodItsCold
I got extensions to work, but there's no way to filter related lists without re-engineering the look/feel of related lists & I'm not sure how much javascript it would take, but I'd guess plenty.
geetageeta
As far as I know, there is no way to customize a standard related list. We can add Visualforce pages only to the detail section of a page. If we want to create a new related list using Visualforce, then we will have to include the detail of the object also in the Visualforce page, but will run into issues I described in this post intitially.
TomSnyderTomSnyder

 

>>2. Since I am adding the related list below the Account detail section, I see the 'Back to Top' and 'Always show me more records per related list' links between the detail section and the custom related list. Is there a way to hide these links or move them to the bottom of the page?

You can add the following style below to your <apex:page> element to hide the 'Back to Top' div.

<style>
.fewerMore { display: none;}
</style>
 
 

 

 
VenkatNYCVenkatNYC

Hi I am trying to do the same, having a custom related list displayed on the bottom of the Accounts page using extensions on the standard controller, I am able to display the custom list on the bottom. 

 

Here the issue i have.

How do I create the Hover links on the top for the custom related list I generated on the bottom? Does any one have success in doing it?

 

Thank you,

 

 

Message Edited by VenkatNYC on 02-03-2009 11:14 AM
VenkatNYCVenkatNYC

Please look to the following post for the answer for the question I asked just above this post.

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=10791#M10791

 

Mayank_JoshiMayank_Joshi

Thanks Tessi ,your solution works for me .

 

>>2. Since I am adding the related list below the Account detail section, I see the 'Back to Top' and 'Always show me more records per related list' links between the detail section and the custom related list. Is there a way to hide these links or move them to the bottom of the page?

You can add the following style below to your <apex:page> element to hide the 'Back to Top' div.

<style>
.fewerMore { display: none;}
</style>