1List<String> acctNames = new List<String>{
2 'Ant Conglomerate',
3 'Bee Collection Agency',
4 'Beetle Brothers Body Shop',
5 'Butterfly Beauty Supplies',
6 'Flea LLC',
7 'Fly Airlines',
8 'Moth Candle Company',
9 'Tick Timepieces',
10 'Wasp Industrial Products',
11 'Weevil Consultancy'
12 };
13
14
15List<Account> newAccts = new List<Account>();
16
17
18for(Integer i = 0; i < 10; i++) {
19 Account newAcct = new Account();
20 newAcct.name = acctNames.get(i);
21 newAcct.BillingCity = 'Suffragette City';
22 newAccts.add(newAcct);
23}
24
25
26newAccts.get(0).rating = 'Warm';
27newAccts.get(1).rating = 'Cold';
28newAccts.get(2).rating = 'Hot';
29newAccts.get(3).rating = 'Cold';
30newAccts.get(4).rating = 'Cold';
31newAccts.get(5).rating = 'Warm';
32newAccts.get(6).rating = 'Hot';
33newAccts.get(7).rating = 'Hot';
34newAccts.get(8).rating = 'Cold';
35newAccts.get(9).rating = 'Warm';
36
37
38for (Integer i = 0; i < 10; i++) System.debug(newAccts.get(i));
39insert newAccts;