Can you populate a set from a soql query? I couldn't get my syntax to work
Set c = [select id From Contact limit 1000 ];
thanks!
Can you populate a set from a soql query? I couldn't get my syntax to work
Set c = [select id From Contact limit 1000 ];
thanks!
You need to declare the type of your set and make use of the set constructor that takes a list as a parameter giving you something like this:
Set<Contact> c = new Set<Contact>( [SELECT Id, Name FROM Contact LIMIT 1000] );