You need to sign in to do that
Don't have an account?
Suresh(Suri)
not getting list of accounts
Hi All
Please see following code.
public class samp { public list<contact> clist=new list<contact>(); public list<Account> alist=new list<Account>(); public samp() { for(contact c:[select department,Languages__c, id,name from contact]) { clist.add(c); } for(account a:[select id from account]) { alist.add(a); } } public list<contact> getcontactlist() { return clist; } }
I am getting following error .please solve my problem,
Error: samp Compile Error: Loop variable must be an SObject or list of Account at line 11 column 13
thank you in advance
I just tried that and it saved without error for me.
Do you have something else defined that is interferinf with it? An apex class called Account perhaps?
Nothing wrong with code. Are you sure this is the complete code and you are facing erro while savinf the class?
Thanks
Ankit Arora
Blog | Facebook | Blog Page