Hidden converted Leads on Lead Dashlet

Please your help to customize the My Leads Dashlet at Home. I need to Hide the converted leads on the dashlet list.

I created a New Custom Dashlet and is working well, but need to change the default filter on the list, similar to this on ListView:

$this->params['custom_where'] = ' AND leads.status <> "Converted" ';
function listViewProcess(){
        $this->lv->searchColumns = $this->searchForm->searchColumns;

        //Filtro para ocultar los Cliente Potenciales Convertidos
        $this->params['custom_where'] = ' AND leads.status <> "Converted" ';
        if(empty($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] == false){
            $this->lv->setup($this->seed, 'custom/modules/Leads/tpls/view.list.tpl', $this->where, $this->params);
            $savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - ' . $_REQUEST['saved_search_select_name']);
            $display = $this->lv->display();
            //echo $this->lv->display();
            echo $display;

I think you can do this without code…

Studio / Leads / Layouts / SuiteCRM Dashlet / SuiteCRM Dashlet Search / add “Converted” field / Save and Deploy
Refresh homepage
Click pencil on Leads dashlet to edit settings
Select Advanced filter, “converted” = No, Save


1 Like

I need to make by code because I will use this for all Users as default filter. For this reason I created a New Custom Lead Dashlet to share this filter to all users.

I found the solution to apply the custom filter to the dashlet list:

I add this code to the MyCustomLeadsDashlet.php

 function process($lvsParams = array(), $id = null) {
        global $current_language, $app_list_strings, $current_user;

        $lvsParams['custom_where'] = '  AND leads.status <> "Converted" ';


1 Like