AnsweredAssumed Answered

How to Add custom buttons on subpanel in sugarcrm 7

Question asked by sidhu sidhu on May 23, 2016
Latest reply on May 23, 2016 by Tevfik Tümer

Hi All

 

      Can any one please update me on how to add a top button on a subpanel of custom module in Accounts module.

 

I have tried this but failed very badly.

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

<?php

 

$viewdefs['Accounts']['base']['layout']['subpanels']['components'][] = array (

  'layout' => 'subpanel',

  'label' => 'LBL_TEST_ACCOUNTS_1_FROM_TEST_TITLE',

  'override_paneltop_view' => 'panel-top-for-test',//added by me

  'context' =>

  array (

    'link' => 'test_accounts_1',

  ),

);

 

 

/<>/custom/modules/Accounts/clients/base/views/panel-top-for-test/panel-top-for-test.php

 

<?php

if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

 

  $viewdefs['Accounts']['base']['view']['panel-top-for-test'] = 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',

                ),

                 array(//my button

  'type' => 'test',

  'name' => 'test',

  'label' => 'LBL_TEST',

  ),

            ),

        ),

    ),

);

 

Regards

Sidhu

Outcomes