Adding Custom Modules to Global Search

bsoremsugar —  September 23, 2010 — 7 Comments

When you add a custom module to your Sugar instance, you probably also want to include it as one of the modules available for Global Search, right?

Here’s an upgrade-safe way of adding a custom module to Global Search.

  • Open the file (or create it):  custom/Extension/modules/YOUR_CUSTOM_MODULE/Ext/Vardefs/vardefs.php
  • Append the file with these lines:
$dictionary['YOUR_CUSTOM_MODULE']['unified_search'] = true;
$dictionary['YOUR_CUSTOM_MODULE']['unified_search_default_enabled'] = true;
$dictionary['YOUR_CUSTOM_MODULE']['fields']['NAME_OF_FIELD_TO_SEARCH']['unified_search'] = true;
  • Run a Quick Repair & Rebuild

If the module was created with Module Builder, remember to use the format pckge_Module, which you can find by looking through your ./custom/modules directory.

In my example, I deployed a package through Module Builder with the package name abcde, and the module name Orders, and I want to search on the Name field.  Using the above steps, filling in the blanks with my particulars:

  • Open the file (or create it): custom/Extension/modules/abcde_Orders/Ext/Vardefs/vardefs.php
  • Append the file with these lines:
$dictionary['abcde_Orders']['unified_search'] = true;
$dictionary['abcde_Orders']['unified_search_default_enabled'] = true;
$dictionary['abcde_Orders']['fields']['name']['unified_search'] = true;
  • Run a Quick Repair & Rebuild

That should do it!  This method is upgrade-safe, and can be included in modules you distribute as well.

7 responses to Adding Custom Modules to Global Search

  1. 

    For me and the sugar CE 6.0.2 that’s don’t works …. Any advice ??

  2. 

    In Sugar CS 6.0, that file just gets over-written when you do a quick repair.

  3. 

    Hi,

    I got this worked on the Global Search and the Global search popup.
    But the result not showing up when we click on Show All button. The result not showing on the Search Results page.
    Please help

    Lijith

  4. 

    I was able to add the custom module to the global search following the directions above. But, the search results display the module’s name of “end123_End_User” rather than the module’s label or “End User”. How does one get the label to display?

Trackbacks and Pingbacks:

  1. Advanced search over multiple modules - December 10, 2012

    [...] [...]

  2. Search for custom modules - May 20, 2013

    [...] [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s