How to turn off the record count at Listview, Subpanel in Sugar7.7

Hello,

I need to hide Total (20 of 21+) because of no need to fire query for fetching count unused query & no need to occupy database resource for that count query.

This runs an extra query on the database server for each sub-panel shown, and is a performance hit which we’d rather not have for a feature which isn’t particularly of interest.

Screen+Shot+2016-04-14+at+10.32.28+PM.png

Thanks

Offshore Evolution Pvt. Ltd.

  • Hi Offshore,

    In order to remove records counts, you can simply duplicate 'clients/base/views/list-headerpane/list-headerpane.php' into custom folder like 'custom/clients/base/views/list-headerpane/list-headerpane.php'

    Then you can delete or command following lines;

    $viewdefs['base']['view']['list-headerpane'] = array(
        'fields' => array(
            array(
                'name' => 'title',
                'type' => 'label',
                'default_value' => 'LBL_MODULE_NAME',
            ),
            // array(
            //     'name' => 'collection-count',
            //     'type' => 'collection-count',
            // ),
        ),
        'buttons' => array(
            array(
                'name'    => 'create_button',
         .
         .
         .
    

    This would remove that counters from list-headerpanes.

    Best Regards

    Tevfik Tümer

    Developer Support Engineer

    1. // array( 
    2.         //     'name' => 'collection-count', 
    3.         //     'type' => 'collection-count', 
    4.         // ), 

    Yes, it's working fine.

    But after that I hope count query should not run for query burden.

    But one more questions,

    How to turn off record count subpanel level ?

    I have tried custom/clients/base/views/panel-top/panel-top.php

    $viewdefs['base']['view']['panel-top'] = array(

        'buttons' => array(

            array(

                'type' => 'actiondropdown',

                'name' => 'panel_dropdown',

                'css_class' => 'pull-right',

                'buttons' => array(

                    array(

                        'type' => 'sticky-rowaction',

                        'icon' => 'fa-plus',

                        'name' => 'create_button',

                        'label' => ' ',

                        'acl_action' => 'create',

                        'tooltip' => 'LBL_CREATE_BUTTON_LABEL',

                    ),

                    array(

                        'type' => 'link-action',

                        'name' => 'select_button',

                        'label' => 'LBL_ASSOC_RELATED_RECORD',

                    ),

                ),

            ),

        ),

        'fields' => array(

            /*array(

                'name' => 'collection-count',

                'type' => 'collection-count',

            ),*/

        ),

    );

  • Hi Offshore,

    I'm glad it worked for you. I would like to clarify your concern about more query for record numbers.

    Technically, displaying count numbers don't change any db query amount. Because Sugar handles the next pages with the current rest api calls. So, if you take a look at rest api responses, you would see a parameter coming called; next_offset.

    Next offset defines that there are more records to fetch, until it returns -1. So collection-count fields are just checking this parameter if they are -1, they don't show you more(number aren't clickable). If there is more, it would give you a clickable number where you can retrieve the amount.

    I hope this explanation make more clear for you.

    About subpanels, the file you are modifiying is correct. Probably your browser cache needs to be refresh. Once you refresh the browser cache you would see that they will disappear. 

    Best Regards

    Tevfik Tümer

    Developer Support Engineer

  • Yes,

    Now It's working for List view & Subpanel both.

    Thanks for Help

    Dipesh Patel

    Offshore Evolution Pvt. Ltd.