How to limit the number of total records in overview based on user input
Question
Application Type
Reactive

Using an aggregate to display table records in an overview to the user. The entity contains (almost) 4000 records.
Want to control / limit the total number of records fetched to 500 at start and not fetch all 4000 data rows. For better performance and prevent runtime errors.
Created a user input field in the filter list web block of the overview and set default to 500. Idea is that user can increase the number in case he need more or all records during filtering.

The max records in pagination is set to 50, so results in 80 pages to display the total 4000. That is the maximum with effect on the number of records per page and not on the total limit.
The user input is set as value in the aggregate Max. Records property. There is an on change action to refresh the aggregate after value changed by user.When navigating to the overview, still all 4000 are fetched and shown in pagination. F.i. setting value 500 to 5, still results in 80 pages, but with 5 records per page and total number of items 4000 in pagination.

How to limit total records to fetch with user input value?


Hi Robert Roersch

your logic should work can you share the module to check it. make sure you refresh the aggregate when UserInput_MaxRecords textbox is changed

Hello Robert Roersch,

The Max Records property limits the number of lines read from the database.

Every time you move forward or backward on the pagination the aggregate is refreshed and another MaxRecords number of lines are retrieved. That means that when you can the aggregate you only bring MaxRecord number of lines each turn be it 5,  500, or over 9000.

What limits the number of pages is the Total Count field of the pagination/navigation block.

I created a small demo that I will leave attached has an oml so you can take a look. 

Hope it helps! 

Paulo Rosário

MaxRecordsVSTotalCount.oml

Thanks for the quick reply and for pointing out to property TotalCount in pagination block.
However did not succeed in getting it to work to 100% in combination with keeping the maximum number of records per page at 50. Pagination did not work properly when calculating the MaxRecords using the NewStartIndex.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.