Created
June 1, 2015 16:31
-
-
Save dmulvi/da373282d3054a2523dd to your computer and use it in GitHub Desktop.
Pre-filter Contacts by Account on Cases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// file location: /custom/modules/Cases/clients/base/views/record/record.php | |
$viewdefs['Cases']['base']['view']['record'] = array ( | |
'buttons' => | |
array( | |
// button stuff here | |
), | |
'panels' => | |
array( | |
// find the panel that has the contact relationship field you want to apply the filter to | |
0 => | |
array ( | |
'name' => 'panel_header', | |
'header' => true, | |
'fields' => | |
// lots of other fields here, removed for brevity | |
array ( | |
20 => | |
// this is where the magic happens, basically telling the contact field to use | |
// the pre-filter we defined in Contacts module | |
array ( | |
'name' => 'contacts_cases_1_name', | |
'label' => 'LBL_CONTACTS_CASES_1_FROM_CONTACTS_TITLE', | |
'initial_filter' => 'filterContactsFromRelatedAccount', | |
'initial_filter_label' => 'Contacts of Related Account', | |
'filter_relate' => | |
array ( | |
'account_id' => 'account_id', | |
), | |
), | |
// end the magic | |
), | |
), | |
), | |
'templateMeta' => | |
array ( | |
'useTabs' => false, | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment