I have trouble with search feature in sugarcrm modules, I always use %-sign in field box example: %john to show search result, i need only john not %john
I was edit my file at /modules/Accounts/Account.php at method:
function build_generic_where_clause ($the_query_string) {
$where_clauses = Array();
$the_query_string = $GLOBALS['db']->quote($the_query_string);
array_push($where_clauses, "accounts.name like '%$the_query_string%' ");
if (is_numeric($the_query_string)) {
array_push($where_clauses, "accounts.phone_alternate like '%$the_query_string%'");
array_push($where_clauses, "accounts.phone_fax like '%$the_query_string%'");
array_push($where_clauses, "accounts.phone_office like '%$the_query_string%'");
}
and edit /modules/Accounts/metadata/SearchFields.php at
'name' => array( 'query_type'=>'default', 'operator' => 'like'),
But Always fail, Do you have solution for this?
Solution
I edited my config.php and added
'search_wildcard_infront' => true
Regards, Rampak