AnsweredAssumed Answered

Custom filter

Question asked by Janin Dancause on May 9, 2018
Latest reply on May 10, 2018 by Sundar Kumar

I'm trying to create a custom filter between two module. The filter should show only related record on calls module for numbers of record from a contact. I have try to do it with the guideline with sugar about that but that doesn't work. I am not sure why it doesn't work. In the module Calls I have a field name polices_c who is a related to the module PO_Police.

 

It imply three modules Contacts, Calls and a Custom one polices.

 

I have three files 

 

custom/Extension/modules/PO_Polices/Ext/Language/en_US.Filterpolice.php

<?php

$mod_strings['LBL_filterDropDownPolice'] = 'Polices';

 

custom/Extension/modules/PO_Polices/Ext/clients/base/filters/basic/filterDropDownPolice.php

<?php

$viewdefs["PO_Polices"]["base"]["filter"]["basic"]["filters"][] = array(
'id' => 'filterDropDownPolice',
'name' => 'LBL_filterDropDownPolice',
'filter_definition' => array(
array(
'po_polices_contacts' => array(
'$contains' => array(),
)
),
'editable' => true,
'is_template' => true,

)

);

 

custom/modules/Calls/clients/base/views/record/record.php

6 =>
array (
'name' => 'polices_c',
'studio' => 'visible',
'label' => 'LBL_POLICES',
'initial_filter' => 'filterDropDownPolice',
'initial_filter_label' => 'LBL_filterDropDownPolice',
'filter_relate' => array(
'po_polices_contacts'=>'parent_id',
),
'editable' => true,
'is_template' => true,

),
7 =>

Outcomes