Reputation: 849
We are fairly new to Sugar CRM, so I am hoping that the problem I am having stems more from a general misunderstanding of how the system works than anything else.
We have added a new module in Sugar CRM Community addition using the Module Builder. One of the fields is meant for the clientId's which are unique to every user. However we have clientId's of varying length (a situation that we can no longer fix) and so rather than what appears to be the default functionality of the Search System to use an "LIKE" operator, we'd like to update it so that when the system searches by clientId it looks for an exact match. (So if we search for clientId 1 - ONLY 1 comes up, not every client id that starts with 1).
Our problem is that we can't see where in the code or the settings we would need to update to make this change. We've tried making a few changes to SearchForm.php file in the includes section, including overiding, changing $opertor to '=' and changing the 'LIKE' case to match the '=' when building the where clause in the generateSearchWhere function, but none of these seem to be changing the search behaviour. So we were hoping that someone would know where in the code (or even better - the interface so we don't have to alter the code ) we would need to look in order to make this change.
Any help would be appreciated!
Thanks
Upvotes: 0
Views: 2996
Reputation: 1464
for some fundamentals, see SugarCRM documentation. However, it isn't very detailed.
To my experience, it should be enough to only add/update:
/custom/modules/<module>/metadata/SearchFields.php
and use something like this:
$searchFields['module']['field'] = array(
'query_type' => 'default',
'operator' => '=');
(Replace module and field with your respective values)
Remeber the clear any caches and rebuild SugarCRM afterwards.
Upvotes: 2