Replace "Create" button in listview header with custom create buttons

Hi,

We are trying to replace the Create button in the Accounts listview header with three buttons corresponding to three type of accounts.

The aim is for these buttons to each behave like a Create button, but to also prepopulate a dropdown value in the form corresponding to the type of account.

Can anyone recommend the best approach here please? Are there any potential barriers that would prevent this?

Cheers,

Levi

Parents Reply Children
  • Is there a template of list-headerpane anywhere that I can use? I dont want to overwrite the existing Create button. 

    I'm the sole user and administrator of my SugarCloud instance- how do I access the platform files?

  • I am not so sure if exists a template, but you can see the folder into route: 

    <SugarCRM_instance>\modules\Accounts\clients\base\views\list\list.php

    If the diagnostic tool gives it to you, but anyway the code must be something like:

    $viewdefs['Accounts']['base']['view']['list'] = array(
    'panels' => array(
    array(
    'name' => 'panel_header',
    'label' => 'LBL_PANEL_1',
    'fields' => array(
    array(
    'name' => 'name',
    'link' => true,
    'label' => 'LBL_LIST_ACCOUNT_NAME',
    'enabled' => true,
    'default' => true,
    'width' => 'xlarge',
    ),
    array(
    'name' => 'billing_address_city',
    'label' => 'LBL_LIST_CITY',
    'enabled' => true,
    'default' => true,
    ),
    array(
    'name' => 'billing_address_country',
    'label' => 'LBL_BILLING_ADDRESS_COUNTRY',
    'enabled' => true,
    'default' => true,
    ),
    array (
    'name' => 'phone_office',
    'label' => 'LBL_LIST_PHONE',
    'enabled' => true,
    'default' => true,
    ),
    array (
    'name' => 'assigned_user_name',
    'label' => 'LBL_LIST_ASSIGNED_USER',
    'id' => 'ASSIGNED_USER_ID',
    'enabled' => true,
    'default' => true,
    ),
    array(
    'name' => 'email',
    'label' => 'LBL_EMAIL_ADDRESS',
    'enabled' => true,
    'default' => true,
    ),
    array(
    'name' => 'date_modified',
    'enabled' => true,
    'default' => true,
    ),
    array (
    'name' => 'date_entered',
    'type' => 'datetime',
    'label' => 'LBL_DATE_ENTERED',
    'enabled' => true,
    'default' => true,
    'readonly' => true,
    ),
    ),

    ),
    ),
    );