Modifying action buttons on subpanels

Hi,

I wanted to stop people from using the quick-create form on Accounts so I followed these instructions and created a file called custom/Extension/modules/Accounts/Ext/Layoutdefs/fullFormCreateContacts.php and everything worked fine.

However, I also wanted to REMOVE the “create” button under the Opportunities subpanel of Accounts so I created a file called hideCreateOpportunities.php with the following code:

<?php
 
$layout_defs["Accounts"]["subpanel_setup"]["opportunities"]["top_buttons"] = array(
array(
'widget_class' => 'SubPanelTopButtonQuickCreate',
),
);

But this has had no affect even after repair/rebuild. What have I done wrong?
Any help most appreciated.
Regards
Andrew

Your code adds the quick create button.

If you want to remove it you have to define just the widgets you want.

for example:

$layout_defs["Accounts"]["subpanel_setup"]["opportunities"]["top_buttons"] = array(
                                array (
                                 'widget_class'=>'SubPanelTopCreateButton',
                                ),
                                array (
                                 'widget_class'=>'SubPanelTopSelectButton',
                                ),
                        ),

With the above example you are defining Top Create and Top Select buttons but not Quick Create