Issue in Adding button to panel-top-for-prospectlists

I am trying to add button in "panel-top-for-prospectlists" in the contacts module by using Extension without overriding. The following is the code but the button is not being added.

<?php

$viewdefs['Contacts']['base']['view']['panel-top-for-prospectlists']['buttons'][]['buttons'][] =
                array(
                    'type' => 'test',
                    'name' => 'test_button',
                    'label' => 'LBL_TEST_BUTTON',
                
);

File Path:

custom/Extension/modules/Contacts/Ext/clients/base/views/panel-top-for-prospectlists/

The following is the Sugar actual code to which button is being added.

<?php
/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * support.sugarcrm.com/.../.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */

$viewdefs['Contacts']['base']['view']['panel-top-for-prospectlists'] = array(
    'type' => 'panel-top',
    'template' => 'panel-top',
    '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(
                    'type' => 'linkfromreportbutton',
                    'name' => 'select_button',
                    'label' => 'LBL_SELECT_REPORTS_BUTTON_LABEL',
                    'initial_filter' => 'by_module',
                    'initial_filter_label' => 'LBL_FILTER_CONTACTS_REPORTS',
                    'filter_populate' => array(
                        'module' => array('Contacts'),
                    ),
                ),
            ),
        ),
    ),
);

Parents
  • Hi, 

    It looks to me you are actually creating another index of first button set. 

    $viewdefs['Contacts']['base']['view']['panel-top-for-prospectlists']['buttons'][]['buttons'][] 

    I did not test it but you can give try adding via 

    $viewdefs['Contacts']['base']['view']['panel-top-for-prospectlists']['buttons'][0]['buttons'][] 

    Hope it helps.

    Tevfik Tümer
    Sr. Developer Support Engineer

Reply
  • Hi, 

    It looks to me you are actually creating another index of first button set. 

    $viewdefs['Contacts']['base']['view']['panel-top-for-prospectlists']['buttons'][]['buttons'][] 

    I did not test it but you can give try adding via 

    $viewdefs['Contacts']['base']['view']['panel-top-for-prospectlists']['buttons'][0]['buttons'][] 

    Hope it helps.

    Tevfik Tümer
    Sr. Developer Support Engineer

Children
No Data