sugarcrm - 在 SuiteCRM 中按 'logged in user' 对订单 ListView 进行排序

标签 sugarcrm suitecrm

删除 ListView 中的默认排序顺序并按 SuiteCRM 中的“登录用户”排序。

最佳答案

在 custom/modules/Prospects(your module)/views/view.list.php 中添加以下代码

 function listViewProcess() {

    global $current_user; 
    $user_name = $current_user->user_name;
    $id = $current_user->id;
    $this->processSearchForm();

        $this->params['custom_order_by'] = ' ORDER BY FIELD(assigned_user_id, "'.$id.'") DESC';
        $this->lv->setup($this->seed, 'include/ListView/ListViewGeneric.tpl', $this->where, $this->params);
        $savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - ' . $_REQUEST['saved_search_select_name']);
        echo $this->lv->display();
} 

custom_order_by 将被视为按字段排序 所以声明

$ret_array['order_by']=''; 在 include/ListView/ListViewData.php

之前

$main_query = $ret_array['select'] . $params['custom_select'] . $ret_array['from'] . $params['custom_from'] . $ret_array['inner_join']. $ret_array['where'] . $params['custom_where'] . $ret_array['order_by'] . $params['custom_order_by'];

关于sugarcrm - 在 SuiteCRM 中按 'logged in user' 对订单 ListView 进行排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32451782/

相关文章:

sugarcrm - 如何将 "target lists"添加到我的自定义模块

sugarcrm - 套件CRM : How to Add Dashlet which renders external project

SugarCRM Sidecar 和客户端教程

api - SugarCRM:不推荐使用 SOAP API 调用?

sugarcrm - 逻辑 Hook "After save"不适用于子面板

php - 如何根据潜在客户 'Campaign' 子面板中的信息在 SugarCRM/SuiteCRM 中创建逻辑 Hook ?

sugarcrm - 如何在SuiteCRM布局中添加字段条件?

sugarcrm - 删除 SugarCRM 自定义模块中的模块列表

php - SugarCRM SugarLogic 公式

php - SugarCRM - 如何为所有用户设置默认主页