AnsweredAssumed Answered

How do you use filter_relate?

Question asked by Jeff Bickart on Feb 19, 2015
Latest reply on Aug 5, 2016 by Francesca Shiekh
In my accounts module, I have added a custom relate field billing_contact_c which is related to Contacts.

When I click the search for more... I'd like to only show the Contacts for the Account that I am currently on.

I have been attempting to follow the directions here and here.

I can successfully make the filter work if I am using assigned_user_id as in the examples but instead I'd like to use account_id

So my definition is:

array(                        'name' => 'billing_contact_name',                        'span' => 12,                        'initial_filter' => 'contacts_by_account_filter',                        'initial_filter_label' => 'LBL_CONTACTS_BY_ACCOUNT_FILTER',                        'filter_relate' =>                            array(                                'account_id' => 'id',                            ),                    ),

If I replace 'id' with an actual id I can get it to work; any idea on how to get Sugar to replace ID with the ID of the current Account I'm on?