More ListView Results Per Page

We recently implemented a highly customized listview-derived screen and didn’t want it to paginate. We’re extending the listview, so naturally the screen wants to limit the number of rows displayed to¬†$GLOBALS['sugar_config']['list_max_entries_per_page'].

To override this variable for just this particular screen, I found the easiest thing to do was something like this:

class ViewMyCustomListView extends ViewList{
  public function display(){
    $true_list_max = $GLOBALS['sugar_config']['list_max_entries_per_page'];
    $GLOBALS['sugar_config']['list_max_entries_per_page'] = '10000';
    $GLOBALS['sugar_config']['list_max_entries_per_page'] = $true_list_max;

I found that using using 0 or -1 one didn’t work like I’d hoped, so the next idea is to just put the value to something unreasonably high. Note that this would cause the system to try to display 10,000 records on the screen if it found them (severe performance hit). We’re using this override in conjunction with a custom “where” clause that ensures only a few dozen records could show up at a given time, so I feel safe with this.

This entry was posted in SugarCRM. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Sage President\

Profiling Solutions, Inc
174 Carroll Street
Atlanta, GA 30312
Sales: 1 (866) 515-9959
Office Phone: (404) 525-8003
Office Fax: (404) 525-8005