1

I have increased the number of records that is shown in a SubPanel for a custom module I created:

<?php

require_once('include/MVC/View/views/view.detail.php');

class cd_TransactionsViewDetail extends ViewDetail
{
    public function display()
    {
        global $sugar_config;

        parent::display();

        $this->saleDisplay();
        $sugar_config['list_max_entries_per_subpanel'] = '100';
    }
}

But when I deleted a record from the SubPanel it oddly jumps back to displaying just 10 records.

Any idea how to get around this? I know its using AJAX to do the delete but I'm not sure where to look.

Karl Hill
  • 12,937
  • 5
  • 58
  • 95
user794846
  • 1,881
  • 5
  • 29
  • 72

2 Answers2

2

You could place it directly within the custom SubPanel metadata:

/custom/modules/[MODULE_NAME]/metadata/subpanels/[YOUR_SUBPANEL_NAME].php

<?php

    $GLOBALS['sugar_config']['list_max_entries_per_subpanel'] = '100';
    $subpanel_layout['list_fields'] = array (
Karl Hill
  • 12,937
  • 5
  • 58
  • 95
0

The only way I could see how to do it was to edit the include/SubPanel/SubPanel.php

find this line:

     $ListView->records_per_page = $sugar_config ['list_max_entries_per_subpanel'] + 0;

and add this before it:

      if($this->parent_module == 'my_module'){

        $sugar_config['list_max_entries_per_subpanel']  = '100';
    }

However I don’t think this will be upgrade safe.

user794846
  • 1,881
  • 5
  • 29
  • 72