Enable Custom Field Global Search

Ok! I managed to get it working about an hour after I posted this! : )

This tutorial does indeed work: DevClub - SugarClub

I was just a dummy, and in the wrong directory! To Reiterate the steps I took:

If you have created the new field in studio already:

You should have a newly created file in /custom/Extension/modules/YOUR_MODULE/Ext/Vardefs/ with the name of your field.

Edit this file from:

<?php
$dictionary['MODULE']['fields']['FIELD_NAME'] ['labelValue'] =['DISPLAY_NAME'];
 ?>

to this:

<?php
$dictionary['MODULE']['fields']['FIELD_NAME'] = array (
    'labelValue' => 'DISPLAY_NAME',
    'unified_search' => 'true',
);
 ?>

Then change to THIS Directory: custom/modules/YOUR_MODULE/metadata/ and edit the SearchFields.php file.

Add this to the array:

 'YOUR_FIELD_NAME' =>
  array (
    'query_type' => 'default',
  ),

Save & Do a Repair & Rebuild from the Admin zone. You may need to ‘edit’/‘save’ the affected records to have them show up in Search!

Cheers,

Bryce

2 Likes