You need to sign in to do that
Don't have an account?

Need a VF guru..... Help with VF related list.... Will give Kudos.
This is the basic page I''m testing with. Below is the VF page code. How do I change the order of all of the related list that appear under the detail section of the on the object?
Thank you, Steve ps I will give Kudos for you if you solve my question
<apex:page standardController="Contact" extensions="sampleDetailPageCon"> //<style> //.fewerMore { display: none;} //</style> <apex:form > <apex:pageMessages /> <apex:detail relatedList="true"></apex:detail> <apex:pageblock id="CustomList" title="Related Opportunities" > <apex:pageBlockTable value="{!oppz}" var="o" rendered="{!NOT(ISNULL(oppz))}"> <apex:column> <apex:commandLink action="/{!o.id}" value="{!o.Name}" /> </apex:column> <apex:column value="{!o.Name}"/> <apex:column value="{!o.Account.Name}"/> <apex:column value="{!o.Type}"/> <apex:column value="{!o.Amount}"></apex:column> <apex:column value="{!o.CloseDate}"/> </apex:pageBlockTable> <apex:outputLabel value="No records to display" rendered="{!(ISNULL(oppz))}" styleClass="noRowsHeader"></apex:outputLabel> </apex:pageblock> </apex:form> </apex:page>
Here is the apex to go wit
public class sampleDetailPageCon { private List<Opportunity> oppz; private Contact cntact; public sampleDetailPageCon(ApexPages.StandardController controller) { this.cntact= (Contact)controller.getRecord(); } public List<Opportunity> getOppz() { Contact con = [Select id, Account.id FROM Contact where id = :cntact.id]; if (con.Account == null) return null; oppz = [Select id, Name, Account.Name, CloseDate, Amount, Type from Opportunity where Account.id = :con.Account.id]; return oppz; } }
Since you are using the <apex:detail/> tag you can rearrange the related lists from the page layout editor.
if you want your custom list to show above any of the original related list you have to to set the relatedList attibute of the apex:detail tag to false and add the related lists to the vfpage ueing the apex:relatedList tag
Example code:
Hope this helps!
All Answers
Hi,
There are two ways by which you can display the records in your defined order in related list.
1:) Change the
2:) Use a wrapper class that will store all opportunity data in the order in which you insert in the list using any custom logic.
I hope this will answer your query.
-S
No sorry I didn't mean the order of the data in the related list I mean like on a opportuntiy screen you have the detail area between the 2 edit buttongs....
Then below that related list from open activities, activity history, opportunity product (line items.... etc... How do I take a VF page with a custom VF related list and organize the page so that my vf list appears in the top down order I chose.... Any ideas?
Thank you,
Steve
Since you are using the <apex:detail/> tag you can rearrange the related lists from the page layout editor.
if you want your custom list to show above any of the original related list you have to to set the relatedList attibute of the apex:detail tag to false and add the related lists to the vfpage ueing the apex:relatedList tag
Example code:
Hope this helps!
Look at updated post above!!! I've added sample code.