Increse number of records into SubPanel ListView

We have increased the number of records that is shown in a subpanel for a custom module.

It will be done by simple steps,

Step 1: create file in custom/modules/<desired_module> view.detail.php and add below code.

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

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

class View<desired_view_name> extends ViewDetail {

	function View<desired_view_name>(){
		parent::ViewDetail();
	}
	
	function display() {
	        $sugar_config['list_max_entries_per_subpanel'] = '100';
	}
}

?>

But when We deleted a record from the subpanel it jumps back to displaying just 10 records.

Any idea how to get round this? I know its using ajax to do the delete but not sure what to look at. For tackle this we need add below code

Step 2: Copy your include/SubPanel/SubPanel.php file to custom/ include/SubPanel/SubPanel.php and find this line $ListView->records_per_page = $sugar_config [‘list_max_entries_per_subpanel’] + 0; and add below code before it:

if($this->parent_module == '<desired_module>'){
     $sugar_config['list_max_entries_per_subpanel']  = '100';
}

Note :

Here, <desired_module> means the module name you see in the URL, for example, Contacts, Leads, etc.
Here, <
YOUR_SUBPANEL_NAME> means your subpanel name.

Hope you find this blog post helpful.

Feel free to add comments and queries, that helps us to improve the quality of posts.

You can contact us at info@infotechbuddies.com

Thank you.

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *