Sugar 7 add filter for subpanel records based on custom field?

I want to add filter for sub-panel records based on a custom field.In contacts I have custom field status_c which is (active or inactive).In Account record, I want to filter the contacts sub-panel to show only active contacts.

I know how to do it in 6 version, but struggling this in sugarcrm 7.5.x version.If someone can help how to achieve this?

I am using Sugarcrm Enterprise 7.9.0.0. I am trying to show few records in "Account_Receivables" subpanel of Account page on basis of particular condition. I tried to implement the solution as mention in above link. The control is going to link_file/link_class. But it is redirecting to http 500 error page. Please provide solution for this issue.

The http 500 error is solved. To solve this issue, I removed some functions like getRelatedTableName() from link-file, which was I took from Link2 class. Now I kept only those functions which is mention in this link "http://shanedowling.com/sugarcrm-7-custom-subpanels/". For this moment, I am not using joinRaw function. I commented all code from this function "buildJoinSugarQuery" and just return $sugar_query to check that it should work as it is previously. Now it is showing subpanel but without data. In sugarcrm log file, it is showing this error "failed to find link for accounts_ar001_account_receivables_1". In vardef file, I set these two parameters too

Here is another way to 'filter' via Accounts extendsFrom: 'RecordView', render: function()

// point to your custom field name$fi=$('div[data-subpanel-link="contacts"]').find('table[class*=table-striped] thead tr th[data-fieldname="deptcat_c"]').closest('th').prevAll().length;//and remove it when it matches a value$('div[data-subpanel-link="contacts"]').find('table[class*=table-striped] tbody tr td').each(function(idx){ if (idx == $fi && $(this).text().trim() == 'HR'){$(this).parent().remove();} }); The custom field needs to be in the subpanel layout.