+ Start a Discussion
CraigHCraigH 

Dynamic sObject collections in Spring '10


In the Spring '10 release notes (p128), the following feature is listed: 
 
 
Generic Collection Creations Now Supported
 
As of Spring '10, you can use generic sObjects to create a collection. For example, the following is now possible:
 
Set<Sobject> foo = new Set<Sobject>();
 
 
I tried this in a partner development edition org (on na7.salesforce.com) and it gets rejected when trying to compile in Eclipse.
 
 
Has anybody else been able to get this to work? 
Best Answer chosen by Admin (Salesforce Developers) 
tmatthiesentmatthiesen
This support was added in the 18.0 API.  In the IDE, you can navigate to the corresponding class metadata file and flip the API version from 16.0 to 18.0.  Obviously not idea, but this workaround will allow you to develop against the new API version in the interim. 

All Answers

mtbclimbermtbclimber
I believe this change was versioned, i.e. you must upgrade the class to version 18 (Spring '10).
paul-lmipaul-lmi
can we even do that without v18 of the IDE, which, from what I've seen, has yet to be released?
tmatthiesentmatthiesen
This support was added in the 18.0 API.  In the IDE, you can navigate to the corresponding class metadata file and flip the API version from 16.0 to 18.0.  Obviously not idea, but this workaround will allow you to develop against the new API version in the interim. 
This was selected as the best answer