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
  • Hi Levi,

    You can add custom buttons in List View Header Pane by extending the list-headerpane folder in the module. You can add buttons in list-headerpane.php by extending it to custom folder in below path l "custom/modules/<module_name>/clients/base/views/list-headerpane/list-headerpane.php

  • How do I access and edit list-headerpane.php?

  • May be You don´t have the folder "list-headerpane" so, I think you must create it in the route of your custom module:

    custom\modules\<your_custom_module_name>\clients\base\views

    That way you overwrite the list-headerpane.php file

    And of course, you must have access to the platform files.

    Regards.

  • 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,
    ),
    ),

    ),
    ),
    );

Reply
  • 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,
    ),
    ),

    ),
    ),
    );

Children
No Data