Skip to content

Make ModelController's default return limit configurable - #573

Draft
nbeatty-gpa wants to merge 1 commit into
masterfrom
recordsPerPageConfiguration
Draft

Make ModelController's default return limit configurable#573
nbeatty-gpa wants to merge 1 commit into
masterfrom
recordsPerPageConfiguration

Conversation

@nbeatty-gpa

@nbeatty-gpa nbeatty-gpa commented Aug 4, 2026

Copy link
Copy Markdown

Get Take value from DefaultRecordsPerPage setting in systemSettings from the configuration file.

Still a draft because models which do not explicitly set the Take value using the Return Limit attribute sometimes behave differently when Take is not null.

For example, in System Center, the ByUser and ByUserGroup pages override ModelController functionality for non-database fields, so they are searched with the model controller, then filtered or sorted according to these fields, before being paginated afterwards. When the Take value is set, the base ModelController SQL query includes "TOP {Take}", which breaks the later filtering, sorting, and pagination.

There also seem to be issues with some models such as Asset when the default is set to a single-digit value, since in trying to link an Asset to an AssetType, it fetches all AssetTypes, but if they have a ReturnLimit it's not guaranteed that an existing record will be pulled and found as a match.

Overall, it seems to me that using the Take value as both a limit for non-paged queries and a page size is problematic, and we would need to make these two values distinct.

@nbeatty-gpa
nbeatty-gpa force-pushed the recordsPerPageConfiguration branch from 1aa6fd0 to ffbc8fa Compare August 4, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant