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
KunlunKunlun 

Is possible to sort record in apex related list?

Hi All

 

I made an account VF. Make contact related list as <apex:relatedList subject="{!account}" list="contacts" />.

 

I want to only show the contacts which has email in this related list. Is it possbile?

 

Thanks

Kunlun

Devendra@SFDCDevendra@SFDC

 

Hi kunlun,

 

Try this:

 

Setup-->Customize-->Account-->Page Layout-->Select page layout which you are working on:

 

Click on related list properties for Contact: You will get option as "Sort By" - Select the field from picklist and select the sort order.

 

Hope this helps.:)

 

Thanks,
Devendra

kiranmutturukiranmutturu

i think this is not sort logic this is kind of filter you want a build a business logic as a realted list ...so u need to construct the logic where the contact email is there and then bind that list to the vf page....or you can do a conditional check in the page itself... but best thing is do ur business logic and get the final list to page and bind the same..hope u got my point