You need to sign in to do that
Don't have an account?
sparky
set of Contacts not allowed??
In the general declarations for a class I'm working on, I have:
Code:
this gives me an error of:
"Compilation error: Set of SOBJECT:Contact not allowed" when I attempt to save it in eclipse.
What's going on?
Code:
private set<Contact> RelatedCons = new set<Contact> ();
this gives me an error of:
"Compilation error: Set of SOBJECT:Contact not allowed" when I attempt to save it in eclipse.
What's going on?
A set is an unordered collection of primitives that do not contain any duplicate elements.
Venkat Polisetti
I could've sworn I had used sets of sobjects in the past, but looking back I see now it was only id's.
Thanks!
Well, the current version of the Apex Developer Guide says:
A set is an unordered collection of primitives or sObjects that do not contain any duplicate elements. For example, the following table represents a set of String, that uses city names:
...and the example shows a set of Accounts...
Currently Sobjects are allowed in Sets but not when we replied to the original message. Read the time of the original post (2007). A lot has changed since then for the better.
Hope this helps.
Venkat