Hello Everyone!
I was wondering if anyone knew how to implement or add a custom field to the global search. I created a custom selection-list in custom/modules/Accounts/clients/base/views/selection-list/selection-list.php, but still not work. Please check my sample code below:
<?php
$viewdefs['Accounts']['base']['view']['selection-list'] = array(
'panels' => array(
array(
'name' => 'panel_header',
'label' => 'LBL_PANEL_1',
'fields' => array(
array(
'name' => 'account_number_c',
'link' => true,
'label' => 'LBL_ACCOUNT_NUMBER_C',
'enabled' => true,
'default' => true,
),
array(
'name' => 'name',
'link' => true,
'label' => 'LBL_LIST_ACCOUNT_NAME',
'enabled' => true,
'default' => true,
),
array(
'name' => 'billing_address_city',
'label' => 'LBL_LIST_CITY',
'enabled' => true,
'default' => true,
),
array(
'name' => 'billing_address_country',
'label' => 'LBL_BILLING_ADDRESS_COUNTRY',
'enabled' => true,
'default' => true,
),
array(
'name' => 'phone_office',
'label' => 'LBL_LIST_PHONE',
'enabled' => true,
'default' => true,
),
array(
'name' => 'assigned_user_name',
'label' => 'LBL_LIST_ASSIGNED_USER',
'id' => 'ASSIGNED_USER_ID',
'enabled' => true,
'default' => false,
),
array(
'name' => 'email',
'label' => 'LBL_EMAIL_ADDRESS',
'enabled' => true,
'default' => false,
),
array(
'name' => 'date_entered',
'type' => 'datetime',
'label' => 'LBL_DATE_ENTERED',
'enabled' => true,
'default' => false,
'readonly' => true,
),
),
),
),
);I tried also following this documention https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_12.1/Architecture/Global_Search, but still not working. Check my code below:
custom/modules/Accounts/clients/base/views/search-list/search-list.php
<?php
$viewdefs['Accounts']['base']['view']['search-list'] = array(
'panels' => array(
array(
'name' => 'primary', // This is mandatory and the word `primary` can not be changed.
'fields' => array(
array(
'name' => 'picture',
'type' => 'avatar',
'size' => 'medium',
'readonly' => true,
'css_class' => 'pull-left',
),
array(
'name' => 'name',
'type' => 'name',
'link' => true,
'label' => 'LBL_SUBJECT',
),
'account_number_c',
),
),
array(
'name' => 'secondary', // This is mandatory and the word `secondary` can not be changed.
'fields' => array(
array(
'name' => 'email',
'label' => 'LBL_PRIMARY_EMAIL',
),
),
),
),
);By the way my custom field is "account_number_c" and I`ve just copied the selection-list.php from Modules folder to Custom Folder.

