AnsweredAssumed Answered

How to customise filter search condition to use subquery in sugar 7.x?

Question asked by Ron Lesh on Sep 18, 2017
Latest reply on Sep 19, 2017 by Ron Lesh

hey champions,


As you know, back in sugar 6.x, we could edit the searchFields.php to add "subquery" to customise the search condition. which was quite flexible.



'favorites_only' => 
array (
  'query_type' => 'format',
  'operator' => 'subquery',
  'subquery' => 'SELECT sugarfavorites.record_id FROM sugarfavorites
                       WHERE sugarfavorites.deleted=0
                           and sugarfavorites.module = \'Cases\'
                           and sugarfavorites.assigned_user_id = \'{0}\'',

We have used this feature in many place in old sugar. After we move to sugar 7.8. we lost all these customisation.

All we can do right now seem just add custom fields to
$viewdefs['Cases']['base']['filter']['default'] to enable particular field as additional filter. 

My questions is how could we continue use the "subquery" operator in sugar 7.x so that we could join any database table to do complex search?

many thanks.