{"title":"TopNumberOfRows Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-topnumberofrows-property/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-topnumberofrows-property, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-topnumberofrows-property","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Specifies the maximum number of rows to include in the resulting data set of a query.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":146,"chars":21},{"level":2,"title":"Property Value","slug":"property-value","at":167,"chars":307},{"level":2,"title":"Syntax","slug":"syntax","at":474,"chars":42},{"level":2,"title":"Remarks","slug":"remarks","at":516,"chars":574},{"level":2,"title":"Related information","slug":"related-information","at":1090,"chars":247}],"text":"> Version: _Available or changed with runtime version 1.0._\nSpecifies the maximum number of rows to include in the resulting data set of a query.\n## Applies to\n Query\n## Property Value\nAn integer that specifies the maximum number of rows to include in the resulting dataset. The default value for this property is 0.\n> NOTE\n> A value of 0 is the same as leaving the property blank. If you set the value to 0, then there is no limit and all rows of the dataset are returned.\n## Syntax\n```al\nTopNumberOfRows = 10;\n```\n## Remarks\nYou use the TopNumberOfRows property to limit the resulting dataset to the first set of rows that are generated for the query. For example, you can include only the first 10 or first 100 rows in the resulting dataset. The TopNumberOfRows property is useful for key performance indicators such as the top number of customers or sales.\nYou can also specify the number of rows to include in the dataset by calling the ../methods-auto/query/queryinstance-topnumberofrows-method from AL. The TopNumberOfRows method will overwrite the TopNumberOfRows property setting.\n## Related information\n../devenv-query-object\nLinking and Joining Data Items<../devenv-query-links-joins>\nAggregating Data in Query Objects<../devenv-query-totals-grouping>\nFiltering Data in Query Objects<../devenv-query-filters>\ndevenv-properties"}