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

how do filter data in related list ?
What is the best way to filter data in related list? I want to filter records in Contact related list in Account page with certain recod types.
The requirement is when certain type of user is logged in he should see the contact records of a specific recordtype in account page contact related list.
Thanks in advance
-John
You can make use of rendered attribute as below.
rendered="{!c.recordtype = 'give the recordtype id'}">
else you can query those records and display them in a page block table
We can do this only if we customize Account page and write our own VF page , correct ? Is it possible without rewriting the page ?
Thanks
-John
No you have write in VF page... you can make use of apex:detail tag which gives you the same look and feel of vanila page then modify the desired related list.
Srini thanks for the prompt reply
I am able to recreate the detail page with apex:detail tag
Now how do I achive this
rendered="{!c.recordtype = 'give the recordtype id'}">
where does c come from ? do i have to write a extention controller as well ?
Could you please show me a usage of it or a reference to a usage?
I am very new to VF & apex
Thanks,
John
Here is the sample code
Srini thanks a lot for your guidance
Right now I have
<apex:page standardController="Account">
<apex:detail />
<apex:pageBlock >
<apex:pageblocktable value="{!account.contacts}" var="c">
<apex:relatedList subject="{!account}" list="Contacts" pageSize="20" rendered="{!c.RecordTypeId ='012A0000000PRXW'}"/>
</apex:pageblocktable>
</apex:pageBlock>
</apex:page>
With this its not filtering the contacts of recordtypeid 012A0000000PRXW in related list . I am able to see contacts with other recordtype ids.
Thanks,
John
Here you should not use the relatedlist tag as is... you have to specify the fields as below.
I was not able to get this work . So I had to do it with a controller code and filter the contacts there before rendering it on relatedlist with pageblocktable....
Can you show me how you accomplished this? I would like to filter the contact list that displays to not include contact that have a contact status of No longer with company.