How to add custom field in Global search ?

I tried to add custom field of Account module in Global search.

please any body guide me for the same.

Parents
  • Hi bhavin,

    1. Add new file under the custom/Extension/modules/YOUR_MODULE/Ext/Vardefs/customGlobalSearchFields.php directory with the following contents:

    <?php

    $dictionary['YOUR_MODULE']['fields']['NAME_OF_FIELD_TO_SEARCH']['unified_search'] = true;

    ex.

    $dictionary['Account']['fields']['accounts_id_c']['unified_search'] = true;

    2.Then, you need to add a search definition for the file, which you can specify in the custom/modules/YOUR_MODULE/metadata/SearchFields.php file as shown below :

    <?php

    $searchFields['YOUR_MODULE']['NAME_OF_FIELD_TO_SEARCH'] = array( 'query_type'=>'default');

    For example :

    If “$searchFields” array is already available then add below code only :

    'accounts_id_c' =>

      array (

        'query_type' => 'default',

      ),

Reply
  • Hi bhavin,

    1. Add new file under the custom/Extension/modules/YOUR_MODULE/Ext/Vardefs/customGlobalSearchFields.php directory with the following contents:

    <?php

    $dictionary['YOUR_MODULE']['fields']['NAME_OF_FIELD_TO_SEARCH']['unified_search'] = true;

    ex.

    $dictionary['Account']['fields']['accounts_id_c']['unified_search'] = true;

    2.Then, you need to add a search definition for the file, which you can specify in the custom/modules/YOUR_MODULE/metadata/SearchFields.php file as shown below :

    <?php

    $searchFields['YOUR_MODULE']['NAME_OF_FIELD_TO_SEARCH'] = array( 'query_type'=>'default');

    For example :

    If “$searchFields” array is already available then add below code only :

    'accounts_id_c' =>

      array (

        'query_type' => 'default',

      ),

Children