[SalesForce] Advanced Filters on Related list

We'd like to be able to create filters on related lists (like creating custom views). For example, we would like people to have the ability to filter out contacts that we've marked as Inactive when they are viewing the related list on an Account. If you could build custom views for related lists like you can on the object page, people could customize the related lists to show only what's important to them.

I know this is not possible out of box and there is an idea posted in ideaexchange.Any ways to achieve this ?

Best Answer

The best way to go about this is to create your own, inline Visualforce customization.

Using a standard controller and extension, You can write a pretty decent related list in no time.

If you want pagination, a good idea is to utilize the standard set controller: http://www.salesforce.com/us/developer/docs/pages/Content/apex_pages_standardsetcontroller.htm

For filtering and sorting, take a look at using jQuery, or perhaps Angular for client side sorting and filtering.

If you're implementing this for multiple types of objects, I would suggest utilizing a visualforce component, field sets, and custom settings to generalize your code, making it reusable.

As a caveat to the above, also keep in mind that related lists are always at the bottom of the page layout. Since you are developing a custom visualforce page, this will actually sit in a section above the rest of the related lists. Furthermore, you'll lose the standard bookmark link at the top of the detail page. You can use javascript hackery to put the link in place for your custom inline page. However, it is a lot of work and trial and error.

Related Topic