2

I've defined a many-to-many relationship between Accounts and a custom module (Tags). Tags have 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

$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 primary module results based upon a filter from a sub-module. Has anyone been through this? This is not a relate field; it's a relationship.

Karl Hill
  • 12,937
  • 5
  • 58
  • 95

1 Answers1

-1

I hope this below article will help you.

Apply initial filter in relate fields and relationship fields with quick(popup) search sugarcrm 7.x

Ajay Kumar
  • 175
  • 7
  • How would you modify this to include a “Contact” Filter on the Accounts? You’d have a relationship from Accounts to Contacts (obviously). When you go to “Accounts” there’s a filter called “Filter By Contact” that allows the user to search via Contact name. – Karl Hill Dec 09 '16 at 19:26