我们对 Sugar CRM 还很陌生,所以我希望我遇到的问题更多地源于对系统工作原理的普遍误解。
我们使用模块生成器在 Sugar CRM 社区添加中添加了一个新模块。其中一个字段用于 clientId,它对于每个用户来说都是唯一的。然而,我们的 clientId 长度不同(我们无法再修复这种情况),因此我们希望更新它,以便当搜索系统默认功能使用“LIKE”运算符时系统通过 clientId 进行搜索,寻找完全匹配的内容。 (因此,如果我们搜索 clientId 1 - 只会出现 1,而不是每个以 1 开头的客户端 ID)。
我们的问题是,我们看不到代码或设置中的哪些位置需要更新才能进行此更改。我们尝试对包含部分中的 SearchForm.php 文件进行一些更改,包括覆盖、将 $opertor 更改为“=”以及在generateSearchWhere 函数中构建 where 子句时更改“LIKE”大小写以匹配“=” ,但这些似乎都没有改变搜索行为。因此,我们希望有人知道我们需要查看代码中的哪个位置(或者更好的是界面,这样我们就不必更改代码)才能进行此更改。
任何帮助将不胜感激!
谢谢
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
发布评论
评论(1)
有关一些基础知识,请参阅 SugarCRM 文档。但是,它不是很详细。
根据我的经验,仅添加/更新就足够了:
/custom/modules//metadata/SearchFields.php
并使用如下内容:(
将模块和字段替换为您各自的值)
请记住清除所有缓存并随后重建 SugarCRM。
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:
(Replace module and field with your respective values)
Remeber the clear any caches and rebuild SugarCRM afterwards.