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
Swapnil PatneSwapnil Patne 

Show related list records but filtered based on record type in visualforce page tabs

I have below code that displays accout detail in a block and different account related lists records in tabs. under those related list tabs I want to show records with specific record type. E.g we have 3 Opportunity record types- Record Type License, Record Type Delegate and Record Type Membership, so opportunity tab on VF page should only display 2 Record Types- License and Membership.

Does anyone know how to filter out unwanted record type from lists? Please can someone help?

Below is my code:

<apex:page standardController="Account" sidebar="false">
<apex:tabPanel >  
        <apex:tab label="Open Tasks" labelWidth="100">
            <apex:relatedList list="OpenActivities"/>
        </apex:tab>
        <apex:tab label="VPP's & PP's" labelWidth="100">
            <apex:relatedList list="Value_Pillars__r"/>
                </apex:tab>
        <apex:tab label="Event Registration" labelWidth="120">
            <apex:relatedList list="ActivityHistories"/>
        </apex:tab>
</apex:tabPanel> 
<apex:tabPanel >  
    <apex:tab label="Key Contacts" labelWidth="100">
        <apex:relatedList list="AccountContactRoles"/>
    </apex:tab>
    <apex:tab label="Opportunities">
        <apex:relatedList list="Opportunities"/>
    </apex:tab>
</apex:tabPanel> 
       
</apex:page>

Many thanks,
Swapnil
Emmanuel Cruz BEmmanuel Cruz B
Hi Swapnil,

I don't think this is possible usign starndard related lists, you will need to create your own related list with an extension class for your visualforce page. Try with the example of this link http://www.saaspie.com/2015/03/02/filtering-records-related-list-using-visualforce/

Hope this helps you.
Emmanuel Cruz