Hi bjones99,
Option 1:
use the Reporting module and assemble the query based on the Contacts module and adding conditions for the fields to the related accounts module. This way you can recreate your advanced search on accounts, but instead get the related contacts as search result.
You can then add the result of your report to a target list.
Option 2:
Reimplement the custom field in accounts in code (instead of Studio) and add it as a searchable field to the contacts module
A: Add the following files:
Add file
custom/Extension/modules/Accounts/Ext/Vardefs/focus_xyz.php
With contents:
<?php
$dictionary['Account']['fields']['focus_xyz_c'] = array (
'name' => 'focus_xyz_c',
'vname' => 'LBL_FOCUX_XYZ',
'type' => 'enum',
'len' => '50',
'default_value' => NULL,
'mass_update' => '1',
'reportable' => '1',
'importable' => 'true',
'options' => 'focus_xyz_list',
);
Add file
custom/Extension/modules/Accounts/Ext/Language/en_us.focus_xyz.php
with contents:
<?php
$mod_strings['LBL_FOCUS_XYZ'] = 'Focus XYZ';
Add file
custom/Extension/modules/Contacts/Ext/Vardefs/focus_xyz.php
With contents:
<?php
$dictionary['Contact']['fields']['account_name']['join_link_name'] = 'accounts_contacts_link';
$dictionary['Contact']['fields']['account_focus_xyz'] = array (
'name' => 'account_focus_xyz',
'rname' => 'focus_xyz_c',
'id_name' => 'account_id',
'vname' => 'LBL_ACCOUNT_FOCUS_XYZ',
'join_name'=>'accounts',
'join_link_name'=>'accounts_contacts_link',
'type' => 'relate',
'link' => 'accounts',
'table' => 'accounts',
'isnull' => 'true',
'module' => 'Accounts',
'dbType' => 'varchar',
'len' => '255',
'source' => 'non-db',
'unified_search' => true,
'massupdate' => false,
);
Add file
custom/Extension/modules/Contacts/Ext/Language/en_us.focus_xyz.php
with contents:
<?php
$mod_strings['LBL_ACCOUNT_FOCUS_XYZ'] = 'Focus XYZ';
B: Do a āQuick repair and rebuildā
C: Open studio, Contacts, Advanced Search and add Focus XYZ to the search fields.
D: Search your contacts by doing an advanced search on Contacts using the available focus search field
You will of course need to migrate the data from the former custom field to the new custom field, like
update accounts as a, accounts_cstm as ac set a.focus_xyz_c = ac.focus_xyz_c where a.id = a.id_c;
Regards,
Jan Siero