You need to sign in to do that
Don't have an account?

Hi, Error in list : line 7, column 18: Loop variable must be of type String
List<string> s =new list<string>{'CESSSSS'}; List<string> s1= new list<string>{'WA'}; List<string> s2= new list<string>{'NZ'}; List<account> acc = new list<account>(); for (account a :[select id,ownerid,billingstate from account where type='Prospect' and name != 's']) { for (account b : s1) { if(b.billingstate == a.billingstate) { a.ownerid='00591128657gfH5'; acc.add(a); } } } update acc;
'for (account b : s1)' - is saying for each account in this list of strings. But a String List doesn't have any accounts, it has Strings.