Monday, July 25, 2011

SugarCRM - Hiding Subpanels with Code

I was using the Display Module Tabs and Subpanels feature of SugarCRM in order to hide the modules that we were not using currently.  The issue i ran into was that not all of the subpanels were being hidden on the modules even though I had set them to be hidden.

For my example, I was trying to hide the subpanels for Activities and History in the Accounts module.  In order to do this, I created a file in custom/Extension/modules/Accounts/Ext/Layoutdefs/ called mycustom.php  and I put the following in there:

<?PHP
unset($layout_defs['Accounts']['subpanel_setup']['activities']);
unset($layout_defs['Accounts']['subpanel_setup']['history']);
?>

I then did a Quick Repair and Rebuild from the Repair link in the Admin module.  This hid those subpanels and should be upgrade safe.


No comments:

Post a Comment