An error message, "Collection size 1,028 exceeds the maximum size of 1,000," is displayed on the screen.
When is this error message displayed?
Collections in Apex are data structures used to store and manage multiple records or values in a single variable. Common types include Lists (ordered collection), Sets (unique unordered collection), and Maps (key-value pairs). While Apex itself does not impose a strict limit on collection size, certain contexts like Visualforce pages restrict collections to a maximum of 1,000 items when rendering data.
Governor Limits are system-enforced restrictions in Salesforce designed to ensure efficient use of shared resources in a multi-tenant environment. These limits control aspects like CPU time, memory usage, and database operations. In this context, while Apex can handle large datasets, there are limits such as the number of records returned in certain operations (e.g., Visualforce rendering limits of 1,000 items per collection), which can trigger errors if exceeded.
This is an error message displayed when the limit of Visualforce page is exceeded. For details, refer to the following article:
apex:repeat
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_repeat.htm
A collection can contain up to 1,000 items.
Please note that this is a limit for Visualforce page itself. The same limit is applied for repetitive output, including <apex:dataList> and <pageBlockTable>. (Similar description of the limitation is found in the reference of each item.)
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_dataList.htm
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_pageBlockTable.htm
For Apex class, this limit was removed from Spring'10 (API 18.0). For the APIs prior to this version, a limit of 1,000 items was applied to Apex class.
000385328

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.