更改SugarCRM搜索功能

发布于 2024-11-05 09:42:26 字数 539 浏览 4 评论 0 原文

我们对 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长不大的小祸害 2024-11-12 09:42:26

有关一些基础知识,请参阅 SugarCRM 文档。但是,它不是很详细。

根据我的经验,仅添加/更新就足够了:

  • /custom/modules//metadata/SearchFields.php

并使用如下内容:(

$searchFields['module']['field'] = array(
    'query_type' => 'default', 
    'operator' => '=');

将模块和字段替换为您各自的值)

请记住清除所有缓存并随后重建 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:

$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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文