基于关系ID在SugarCRM中实现自定义过滤器

I've defined a many-to-many relationship between Accounts and a custom module (Tags). Tags has a subpanel in Accounts, however I need a custom filter on Accounts that will show all the Accounts records related to the Tag name you type in.

/custom/Extension/modules/Accounts/Ext/clients/base/basic/filterAccountsByTag.php

<?php
$viewdefs['Account']['base']['filter']['basic']['filters'][] = array(
    'id' => 'filterAccountsByTag',
    'name' => 'LBL_FILTER_ACCOUNTS_BY_TAG',
    'filter_definition' => array(
        array(
            'custom_tags_accountscustom_tags_ida'  => array(
                '$equals' => ' ',
            ),
        ),
        array(
            'name' => ''
        )
    ),
    'editable' => false,
    'is_template' => false
);

To sum it up, I want to display the results of the primary module based upon a filter from a sub-module. Anyone been through this? This is not a relate field, it's a relationship.