gpt4 book ai didi

php - sugarcrm 过滤器按字段排序

转载 作者:搜寻专家 更新时间:2023-10-31 21:02:35 25 4
gpt4 key购买 nike

我正在尝试在 SugarCRM 7.7 中创建过滤器。我在客户模块工作。

我的新过滤器名称是“下次审核日期”。 enter image description here

我已经在我的里面创建了一个文件src/modules/mynewfiltermodule/clients/base/filters/nextreviewdate/nextreviewsate.php

$viewdefs[$module_name]['base']['filter']['nextreviewdate'] = array(
'create' => false,
'filters' => array(
array(
'id' => 'nextreviewdate',
'name' => 'LBL_NEXT_REVIEW_DATE_ONLY_FILTER',
'filter_definition' => array(
array(
'next_review_date' => 'orderby ASC',
),
),
'editable' => false,
),
),

);

我想按next_review_date中的字段按ASC顺序排序,它是一个日期字段。

谁能帮帮我。我该怎么做?

最佳答案


http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.5/UI_Model/Views/Filters/index.html

在此链接中,无法在过滤器中进行排序。但我有一个想法,你使用你的过滤器并在那里应用默认过滤器。

custom/modules/module_name/clients/base/views/list/list.php

'orderBy' =>
array (
'field' => 'nextreviewdate',
'direction' => 'ASC',
),

这将设置默认排序顺序。我只找到了这个解决方案。
我认为这可能对您有所帮助。

关于php - sugarcrm 过滤器按字段排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39120056/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com