How to add a custom module to Global Search

Does anyone know how to add a custom module to the global search function?

I have edited existing modules, renamed them, added fields, etc. For these new, custom fields, I was able to find the config file for them and change the $dictionary[‘MODULE_NAME’][‘fields’][‘name’][‘unified_search’]= to true

However, the modules that I created from scratch, don’t have config files located in the same directory as the pre-existing ones.

For example, my pre-existing module config files are found here:
/var/www/html/custom/Extension/modules/[MODULE_NAME]/Ext/Vardefs/

I did a search for the modules that I created from scratch and found the following locations listed:
/var/www/html/custom/modulebuilder/builds/
/var/www/html/custom/modulebuilder/packages/
/var/www/html/custom/modulebuilder/packages/[MODULE_NAME]/modules/[MODULE_NAME]
/var/www/html/custom/history/modulebuilder/packages/
/var/www/html/custom/history/varmodulebuilder/packages/[MODULE_NAME]/modules/[MODULE_NAME]

Each of these locations has a vardefs.php file nested a few directories under the above location ( for example: /var/www/html/custom/modulebuilder/builds/[MODULE_NAME]/SugarModules/modules/BAR_[MODULE_NAME]/vardefs.php

I’ve tried updating each of those vardefs config files to allow the specific categories to be searchable, but nothing has worked. After each change, I cleared cache, restarted services, did the “Quick Repair and Rebuild” option, and even did some reboots to make sure all the settings were being updated.

Am I missing something? Is there a way to get these custom (built from scratch) modules to be searchable?

Any help anyone can provide would be greatly appreciated. Thank you!

Check this post for ideas:

Hey BrozTechnologies!

Thank you so much for your help. That is actually one of the article that I found and it was helpful for the modules that already existed. I was able to add the custom fields that I added (or edited) to the pre-existing modules using the method mentioned. However, none of the modules that I created from scratch are listed in the directory with the ones that were already there (/var/www/html/custom/Extension/modules/[MODULE_NAME]/Ext/Vardefs/ )

Instead, I was only able to find the following directories for the modules made from scratch:
/var/www/html/custom/modulebuilder/builds/
/var/www/html/custom/modulebuilder/packages/
/var/www/html/custom/modulebuilder/packages/[MODULE_NAME]/modules/[MODULE_NAME]
/var/www/html/custom/history/modulebuilder/packages/
/var/www/html/custom/history/varmodulebuilder/packages/[MODULE_NAME]/modules/[MODULE_NAME]

Do you know if there’s a way to have my custom modules added to the directory where the pre-installed modules exist? I edited the vardefs.php file for each of my custom modules (in each of the directories that I could find for them), but the changes didn’t apply.

I really appreciate your time! Thank you!

Aren’t your custom modules (made with Module Builder) also found under /var/www/html/modules?

Hey @pgr!

Yes, they are listed there! Thank you for pointing that out. I thought they had to be edited under the /var/www/html/custom… directory

So, with your help, I was able to locate the vardefs.php file for my custom modules (example file location is: /var/www/html/modules/SSL_SSLServices/vardefs.php )

I have edited that specific vardefs.php file so that each of the [‘unified_search’] values that I would like to search for are now set to “true” I have done a repair and rebuild, but the module is still not searchable. Do you know if I’m missing something else, or doing something wrong?

Thank you so much for your time!

I’m sorry but I can’t help much further, I never dived into this area of SuiteCRM, I don’t understand exactly how search indexing works… :man_shrugging:

Could you check the Admin / Search Settings page if your custom module is enabled ?

Hey @blqt!

Yes! Woo hoo!! Thank you so much for reaching out. It seems like your advice in addition to @pgr and @BrozTechnologies did the trick! Seems like it was the final missing piece to the puzzle.

For some reason, my custom modules were NOT previously showing up in the Admin / Search area, until the “$dictionary[‘MODULE_NAME’][‘fields’][‘name’][‘unified_search’]=” flag was set to true

For future reference and anyone looking back on this, the steps were as follows:

  • Set the unified_search option to “true” for any custom fields that you’ve created under your custom modules in the correct vardefs.php file. For example, my custom modules are located here: /var/www/html/modules (instead of /var/www/html/custom/Extension/modules/ )
  • Do the repair/rebuild option
  • Go to the Admin → Search Settings page, and locate your custom module name in the “Disabled Modules” section and move it to the “Enabled Modules” section, then save.

Thanks to all three of you for your awesome assistance with this! I really appreciate everyone’s time, and hope you all have a great day!

4 Likes