AnsweredAssumed Answered

Add button on default subpanel under defualt module sugarcrm 7

Question asked by Maulik Shah on Mar 20, 2015
Latest reply on Apr 27, 2015 by Maulik Shah
Hello,
I want to add my custom button in default subpanel(Leads subpanel) under default module(Account module) in sugarcrm 7.

I have tried but failed with this code as describe below.

I have followed these steps:-

1) create file in with code:- 

<sugar_root>/custom/Extension/modules/Accounts/Ext/clients/base/layouts/subpanels/subpanels.php

$viewdefs['Accounts']['base']['layout']['subpanels'] = array (  'components' => array (
      array(
          'layout' => 'subpanel',
          'label' => 'LBL_LEADS_SUBPANEL_TITLE',
          'override_paneltop_view' => 'panel-top-for-accounts',
          'context' => array(
              'link' => 'leads',
          ),
      ),
  ),
);

2) Then I created panel-top-for-accounts.php file 

<sugar_root>/custom/modules/Leads/clients/base/views/panel-top-for-accounts/panel-top-for-accounts.php 

<?php

$viewdefs['Leads']['base']['view']['panel-top-for-accounts'] = array(
    'type' => 'panel-top',
    'buttons' => array(
        array(
            'type' => 'button',
            'css_class' => 'btn-invisible',
            'icon' => 'icon-chevron-up',
            'tooltip' => 'LBL_TOGGLE_VISIBILITY',
        ),
        array(
            'type' => 'actiondropdown',
            'name' => 'panel_dropdown',
            'css_class' => 'pull-right',
            'buttons' => array(
                array(
                    'type' => 'sticky-rowaction',
                    'icon' => 'icon-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',
                ),
                array(
                    'type' => 'link-action',
                    'name' => 'custom_button',
                    'label' => 'Custom Button',
                ),
            ),
        ),
    ),
);

3) Quick Repair and Rebuild.

It did not work.
but if i do this in main files then it works.

how can i do this in upgrade safe manner?

Thanks.

Outcomes