AnsweredAssumed Answered

custom search field from many to many not working in popup view

Question asked by andy91 on May 11, 2015
Latest reply on May 12, 2015 by andy91
I am using SugarCrm CE 6.5.20, Out the box it does not allow searching from related modules with a many to many relationship. But this can be overcome by adding a custom relate field that respresents your relationship then using a custom subquery in SearchFields.php like so :

'par_med_cond' => 
array (
  'query_type' => 'default',
  'operator' => 'subquery',
  'subquery' => 'SELECT spsmc.frp_fundraisingprogram_contacts_1contacts_idb FROM frp_fundraisingprogram_contacts_1_c spsmc LEFT JOIN frp_fundraisingprogram smc ON spsmc.frp_fundraisingprogram_contacts_1frp_fundraisingprogram_ida = smc.id WHERE smc.deleted =0 AND spsmc.deleted =0 AND smc.name LIKE',
  'db_field' =>
  array (
    0 => 'id',
  ),
),

This works on a normal listview advanced search panel but does not work when adding the field to popupview search.

Anybody know how to get this working with the popup view Im at a loss here.

Outcomes