Salesforce Developers Blog

Apex Code Enhancements and Collections best practices

Avatar for Quinton WallQuinton Wall
Spring 10 removes the limit on number of items in a collection. In order to take the most efficient advantage of this change, check out some of the new features available in SOQL to supercharge your code.
January 29, 2010
Listen to this article
0:00 / 0:00

Spring '10 is just around the corner, with many great new features. One of the Apex Code enhancements which caught my attention was the limits on the number of items a collection can hold has been removed. The previous limit was set at 1000. Add this to the new ability to use generic sObjects to create a collection and Collections within the platform just got a whole lot more powerful.

As Ben Parker, the o-so-wise uncle of Peter Parker (aka Spiderman) once said: "with great power comes great responsibility." Changes to Collections is no different, and require some new thinking in regards to best practices.

The release notes, for example, mention that there is still a limit on heap size so care must be taken to not load up a collection and hit this limit. Good news is that a few other other Spring '10 changes can certainly be used to ensure you design your applications as efficiently as possible. 

Here are just a few new SOQL clauses and functions which can be used with collections to help make the most fo the changes.

This is certainly not a complete list, but should certainly be something every developer is familiar with.

Get the latest Salesforce Developer blog posts and podcast episodes via Slack or RSS.

Add to Slack Subscribe to RSS

More Blog Posts

The Salesforce Developer’s Guide to the Summer ’24 Release

The Salesforce Developer’s Guide to the Summer ’24 Release

The Summer ’24 release is here! In this post, we highlight what’s new for developers across the Salesforce ecosystem.May 07, 2024