Sugar uses a type-ahead combo box system called QuickSearch that utilizes components from the YUI framework.
The first ten results are displayed in the browser. If the user refines the search, and the result set is a subset of the first call then no additional call is made. If the result set of the first call is equal to the limit (30), then an additional call is made.
Requirements for a QuickSearch Field
Requirements for a QuickSearch field are listed below:
- Class of the field is set to sqsEnabled
- Field is not set to disabled or readOnly
- JS array sqs_objects is defined and contains the field name
- sugar_grp1_yui.jsmust be loaded on the page
Disabling Automatic Filling
Add the string sqsNoAutofill to the field class to disable automatic filling of the field on blur.
array ( 'name' => 'account_name', 'displayParams' => array ( 'hiddeButtons' =>'true', 'size' => 30, 'class' => 'sqsEnabled sqsNoAutofill' ) ),
Imposing a Delay in QuickSearch
On high performance systems, QuickSearch querying can lead to unintended results because the query returns quickly before the user has finished typing the full string they wish to search. A system administrator can enforce a strict delay on quicksearch fields so that a search will not be performed until X number of seconds have elapsed after a user last stopped typing. To add this parameter, open the ./config_override.php file and enter the following code:
$sugar_config['quicksearch_querydelay'] = 1;
The value is in whole seconds and it is recommended not to exceed 1 second unless explicitly requested by your users. Anything longer than 1 second could be seen as an annoyance due to an extended wait. Once this code is entered, save the file. Users will need to log out and clear their browser cache before this change is reflected in their instance of Sugar.