+ Start a Discussion

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?






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.:)




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