Always add a wildcard at beginning of a search term

There was a question on the SugarCRM forums today that asked if anyone has found an upgrade-safe way to customize searches to always add a % to the beginning of a search (http://forums.sugarcrm.com/f3/auto-wildcard-74128/). Being able to add a wildcard is useful if you are searching for something that may exist in the middle of a value and not necessarily at the beginning. For example, you know a lead you’ve been working on contains “Auto” in it, but you aren’t sure where. You can manually search for %Auto and it will return any lead that contains “Auto” anywhere in the name. (FYI – the search wildcard is always added to the end of a search)

Some would prefer that the search always act this way. In the past, a hack had to be done to include/SearchForm/SearchForm2.php. Since that time, SugarCRM has added a global config option. Simply add the following to your config_override.php:


'search_wildcard_infront' => true,

There are tons of undocumented or hard to find documentation on options such as this. If enough people would find it useful I’d be willing to take a shot at writing a parser that extracts nuggets such as this from the code.

about

I make high quality solutions at an alarming rate.

6 Responses to “Always add a wildcard at beginning of a search term”

  1. Jeff November 30, 2012 at 9:32 pm # Reply

    Here is a link to all of the 6.4 sugar_config variables
    https://docs.google.com/a/neposystems.com/spreadsheet/lv?key=0Am6GpxrpDilwdEVLWl94X0s4R3pIVlRlMjR3SmtqYlE&pli=1

    • jason November 30, 2012 at 9:58 pm # Reply

      So cruel! Any way to get something like this public? How did you go about collecting all of them?

    • Matthew Poer November 30, 2012 at 11:19 pm # Reply

      THIS IS A THING? Just to reiterate, a complete list of these would be awesome, and the documentation just isn’t out there right now.

    • Matthew Poer November 30, 2012 at 11:19 pm # Reply

      Requesting access!

  2. Mayer Elyashiv January 6, 2013 at 10:40 am # Reply

    Requesting access

  3. Graveworm April 5, 2013 at 5:06 am # Reply

    Thank you!

Leave a Reply