Skip to content

Instantly share code, notes, and snippets.

@isTest (seeAllData = true)
public class SOQLqueries {
static testMethod void SOQLandCollections(){
//This only works when this test Class is set to SeeAllData=True!
List<Account> accts = [SELECT ID FROM Account];
System.debug(accts.size());
System.debug(accts);
//System.debug(accts[0].Name);//This won't work because Name was not acquired in the query.
accts = [SELECT ID, Name, Phone, BillingState FROM Account];