Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a newbie to salesforce.

  • I have a requirement where I need to override the Contact related list and have to make the columns sortable(ascending and descending) when the user clicks on the column.

  • Another requirement is there is a field called Active__c == true which is a checkbox. If that active is checked then only those contacts should appear in the related list with all those standard functionalities like new contact button,edit,delete,next,previous links etc.

Whether it can be done. If yes how? Please guide me.


share|improve this question

closed as too broad by Ratan, Adrian Larson, Chris Duncombe, Vamsi Krishna, crmprogdev Feb 23 at 13:57

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

You need to create an inline VF page for this, as we can not customize the standard related lists – SFDC Learner Feb 23 at 6:30
Hi Nilesh,Thanks for the reply....How the sorting option can be added to the column..?If you have any example that will be helpful... – Learner_sfdc Feb 23 at 6:37

Custom Fiter:

You need a separate VisualForce page for sure. This blog explains creating a new VisualForce page with custom conditions as you wanted. You can add filters in the SOQL while retrieving related entries as below:

 Contact con = [Select id, FROM Contact where Active__c = true Limit 5];


For sorting, filtering and pagination I have used DataTables which does really a good job in manipulating client side tabular data. Refer the example here

share|improve this answer
Hi Karthik,Thanks for the reply....will try this solution and will let you know... – Learner_sfdc Feb 23 at 7:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.