Modify (Hide Columns, Show Columns) on "History" Subpanel

Running version 7.14
I’m trying to hide a couple of columns, and perhaps add a column or 2 to the History subpanel.
I believe I’ve read all the relevant posts on this subject, but still seems to not have a documented solution?

I’ve modified the layout in this file:
\modules\History\metadata\subpaneldefs.php
by commenting out all the array elements for ā€œdate_modifiedā€, quick rebuild, cleared cache, but still the column is present.

                /*
                array(
                    'name' => 'date_modified',
                    //'db_alias_to' => 'the_date',
                    'vname' => 'LBL_LIST_LAST_MODIFIED',
                    'width' => '10%',
                ),
                */

Anyone have any ideas?
Mr. Ninja - @pgr ??

That’s interesting!

Make sure you’re checking same module on the browser that you’re working on. :grin:

Try to clear browser cache too.

Definitely been clearing the cache…
I’m not sure I follow your first comment though:

Make sure you’re checking same module on the browser that you’re comments to.

??
I’m looking at the History Panel on the Account module…But modifying this file:
\modules\History\metadata\subpaneldefs.php
Are you suggesting I need to look in the ā€œAccountā€ module somewhere as well??
(I’m not seeing any ā€œHistoryā€ subpanel files there??)

So, you want to hide column from the History subpanel from all modules?

There are almost 7-9 data_modified code in this file. Are you commented all of them?

Pretty sure I got them all…right??

<?php
if (!defined('sugarEntry') || !sugarEntry) {
    die('Not A Valid Entry Point');
}
/**
 *
 * SugarCRM Community Edition is a customer relationship management program developed by
 * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
 *
 * SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
 * Copyright (C) 2011 - 2018 SalesAgility Ltd.
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 *
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 *
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 *
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
 * reasonably feasible for technical reasons, the Appropriate Legal Notices must
 * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
 */




$layout_defs['History'] = array(
    // default subpanel provided by this SugarBean
    'default_subpanel_define' => array(
        'subpanel_title' => 'LBL_DEFAULT_SUBPANEL_TITLE',
        'top_buttons' => array(
            array('widget_class' => 'SubPanelTopCreateNoteButton'),
            array('widget_class' => 'SubPanelTopArchiveEmailButton'),
            array('widget_class' => 'SubPanelTopSummaryButton'),
        ),
        
//TODO try and merge with the activities
        'list_fields' => array(
            'Meetings' => array(
                'columns' => array(
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelIcon',
                        'module' => 'Meetings',
                        'width' => '2%',
                    ),
                    array(
                        'name' => 'name',
                        'vname' => 'LBL_LIST_SUBJECT',
                        'widget_class' => 'SubPanelDetailViewLink',
                        'width' => '28%',
                    ),
                    array(
                        'name' => 'status',
                        'vname' => 'LBL_LIST_STATUS',
                        'width' => '10%',
                    ),
                    array(
                        'name' => 'contact_name',
                        'module' => 'Contacts',
                        'widget_class' => 'SubPanelDetailViewLink',
                        'target_record_key' => 'contact_id',
                        'target_module' => 'Contacts',
                        'vname' => 'LBL_LIST_CONTACT',
                        'width' => '20%',
                    ),
                    array(
                        'name' => 'parent_name',
                        'module' => 'Meetings',
                        'vname' => 'LBL_LIST_RELATED_TO',
                        'width' => '22%',
                    ),
                    /*
                    array(
                        'name' => 'date_modified',
                        //'db_alias_to' => 'the_date',
                        'vname' => 'LBL_LIST_LAST_MODIFIED',
                        'width' => '10%',
                    ),
                    */
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelEditButton',
                        'module' => 'Meetings',
                        'width' => '4%',
                    ),
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelRemoveButton',
                        'linked_field' => 'meetings',
                        'module' => 'Meetings',
                        'width' => '4%',
                    ),
                ),
                'where' => "(meetings.status='Held' OR meetings.status='Not Held')",
                'order_by' => 'meetings.date_modified',
            ),
            'Emails' => array(
                'columns' => array(
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelIcon',
                        'module' => 'Emails',
                        'width' => '2%',
                    ),
                    array(
                        'name' => 'name',
                        'vname' => 'LBL_LIST_SUBJECT',
                        'widget_class' => 'SubPanelDetailViewLink',
                        'width' => '28%',
                    ),
                    array(
                        'name' => 'status',
                        'vname' => 'LBL_LIST_STATUS',
                        'width' => '10%',
                    ),
                    array(
                        'name' => 'category_id',
                        'vname' => 'LBL_LIST_CATEGORY',
                        'width' => '10%',
                    ),
                    array(
                        'name' => 'contact_name',
                        'module' => 'Contacts',
                        'widget_class' => 'SubPanelDetailViewLink',
                        'target_record_key' => 'contact_id',
                        'target_module' => 'Contacts',
                        'vname' => 'LBL_LIST_CONTACT',
                        'width' => '20%',
                    ),
                    array(
                        'name' => 'parent_name',
                        'module' => 'Emails',
                        'vname' => 'LBL_LIST_RELATED_TO',
                        'width' => '22%',
                    ),
                    /*
                    array(
                        'name' => 'date_modified',
                        //'db_alias_to' => 'the_date',
                        'vname' => 'LBL_LIST_LAST_MODIFIED',
                        'width' => '10%',
                    ),
                    */
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelEditButton',
                        'module' => 'Emails',
                        'width' => '4%',
                    ),
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelRemoveButton',
                        'linked_field' => 'emails',
                        'module' => 'Emails',
                        'width' => '4%',
                    ),
                ),
                'where' => "(emails.status='sent')",
                'order_by' => 'emails.date_modified',
            ),
            'Notes' => array(
                'columns' => array(
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelIcon',
                        'module' => 'Notes',
                        'width' => '2%',
                    ),
                    array(
                        'name' => 'name',
                        'vname' => 'LBL_LIST_SUBJECT',
                        'widget_class' => 'SubPanelDetailViewLink',
                        'width' => '28%',
                    ),
                    array( // this column does not exist on
                        'name' => 'status',
                        'vname' => 'LBL_LIST_STATUS',
                        'width' => '10%',
                    ),
                    array(
                        'name' => 'contact_name',
                        'module' => 'Contacts',
                        'widget_class' => 'SubPanelDetailViewLink',
                        'target_record_key' => 'contact_id',
                        'target_module' => 'Contacts',
                        'vname' => 'LBL_LIST_CONTACT',
                        'width' => '20%',
                    ),
                    array(
                        'name' => 'parent_name',
                        'module' => 'Notes',
                        'vname' => 'LBL_LIST_RELATED_TO',
                        'width' => '22%',
                    ),
                    /*
                    array(
                        'name' => 'date_modified',
                        //'db_alias_to' => 'the_date',
                        'vname' => 'LBL_LIST_LAST_MODIFIED',
                        'width' => '10%',
                    ),
                    */
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelEditButton',
                        'module' => 'Notes',
                        'width' => '4%',
                    ),
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelRemoveButton',
                        'linked_field' => 'notes',
                        'module' => 'Notes',
                        'width' => '4%',
                    ),
                ),
                'where' => '',
                'order_by' => 'notes.date_modified',
            ),
            'Tasks' => array(
                'columns' => array(
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelIcon',
                        'module' => 'Tasks',
                        'width' => '2%',
                    ),
                    array(
                        'name' => 'name',
                        'vname' => 'LBL_LIST_SUBJECT',
                        'widget_class' => 'SubPanelDetailViewLink',
                        'width' => '28%',
                    ),
                    array(
                        'name' => 'status',
                        'vname' => 'LBL_LIST_STATUS',
                        'width' => '10%',
                    ),
                    array(
                        'name' => 'contact_name',
                        'module' => 'Contacts',
                        'widget_class' => 'SubPanelDetailViewLink',
                        'target_record_key' => 'contact_id',
                        'target_module' => 'Contacts',
                        'vname' => 'LBL_LIST_CONTACT',
                        'width' => '20%',
                    ),
                    array(
                        'name' => 'parent_name',
                        'module' => 'Tasks',
                        'vname' => 'LBL_LIST_RELATED_TO',
                        'width' => '22%',
                    ),
                    /*
                    array(
                        'name' => 'date_modified',
                        //'db_alias_to' => 'the_date',
                        'vname' => 'LBL_LIST_LAST_MODIFIED',
                        'width' => '10%',
                    ),
                    */
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelEditButton',
                        'module' => 'Tasks',
                        'width' => '4%',
                    ),
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelRemoveButton',
                        'linked_field' => 'tasks',
                        'module' => 'Tasks',
                        'width' => '4%',
                    ),
                ),
                'where' => "(tasks.status='Completed' OR tasks.status='Deferred')",
                'order_by' => 'tasks.date_start',
            ),
            'Calls' => array(
                'columns' => array(
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelIcon',
                        'module' => 'Calls',
                        'width' => '2%',
                    ),
                    array(
                        'name' => 'name',
                        'vname' => 'LBL_LIST_SUBJECT',
                        'widget_class' => 'SubPanelDetailViewLink',
                        'width' => '28%',
                    ),
                    array(
                        'name' => 'status',
                        'vname' => 'LBL_LIST_STATUS',
                        'width' => '10%',
                    ),
                    array(
                        'name' => 'contact_name',
                        'module' => 'Contacts',
                        'widget_class' => 'SubPanelDetailViewLink',
                        'target_record_key' => 'contact_id',
                        'target_module' => 'Contacts',
                        'vname' => 'LBL_LIST_CONTACT',
                        'width' => '20%',
                    ),
                    array(
                        'name' => 'parent_name',
                        'module' => 'Meetings',
                        'vname' => 'LBL_LIST_RELATED_TO',
                        'width' => '22%',
                    ),
                    /*
                    array(
                        'name' => 'date_modified',
                        //'db_alias_to' => 'the_date',
                        'vname' => 'LBL_LIST_LAST_MODIFIED',
                        'width' => '10%',
                    ),
                    */
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelEditButton',
                        'module' => 'Calls',
                        'width' => '4%',
                    ),
                    array(
                        'name' => 'nothing',
                        'widget_class' => 'SubPanelRemoveButton',
                        'linked_field' => 'calls',
                        'module' => 'Calls',
                        'width' => '4%',
                    ),
                ),
                'where' => "(calls.status='Held' OR calls.status='Not Held')",
                'order_by' => 'calls.date_modified',
            ),
        ),
    ),
);

There is repair activities option but I guess it is for different subpanel.

Yeah…I tried ā€˜all’ the repair tools working on this…heh; seems to make no difference.

Haha can you delete cache/themes folder and then reload the page?

sudo rm -r cache/themes/

Clever idea!
Still no joy…columns are still there.
About 1/2 ready to hide them with Jquery… :rofl: :joy: :face_with_peeking_eye: :face_with_peeking_eye: :grimacing:

:rofl: :joy: Yeah, I think you can use JS to hide them if needed.

The following steps might be helpful:

  1. Copy the file ā€˜modules/Meetings/metadata/subpanels/ForHistory.php’ and paste it at ā€˜custom/modules/Meetings/metadata/subpanels/ForHistory.php’.
  2. Set the property 'usage' => 'query_only' for the required column to hide it as
 'date_modified' => [
            'vname' => 'LBL_LIST_DATE_MODIFIED',
            'width' => '10%',
			'usage' => 'query_only',
        ],
  1. Perform a Quick Repair and Rebuild.
1 Like

If you want to hide date modified you have to do what Harshad recommended for ALL modules in the history. IE calls, tasks, meetings, emails otherwise the column will still show as long as one of these modules is present in the history.

Thanks a lot! @TobyTkd please try this out! :grin:

Hey thanks!

This DOES seem to work if you find all the modules that are reflected in the History subpanel, and make this update.

However…I’m not able to get the ā€œEmailā€ items to follow suit.

I’ve added the query_only array element, but it still refuses to remove this from the list.
Any thoughts on Email specific differences??

I remember fighting this when I was building a custom history subpanel. When I get a chance I’ll have a look at what I did. I do remember the emails being slightly different, but don’t remember of the top of my head. (also repair and rebuild!)

Make sure none of the forhistory has :grin:

 'force_exists' => true

For that field.

1 Like

Thank you for finding out the solution :partying_face:

The other thing that just jogged my memory is that there is no ā€œdate modifiedā€ for emails. I think in the forhistory for emails it uses ā€œdate createdā€ because ther is no date modified. Check that too in the forhistory layout.

Yeah…I noticed that it’s a little different.

Seems this still doesn’t eliminate the column, but the rest of it got me far enough to be ā€˜good enough’ for my use case for now.

Thanks a million for the help!