I am not familiar in development side.am getting loop variable must be type like that. How can I resolve above the issue please can any one help me for this issue.I mention below err line in for loop..
public class dependentcon
{
public string cont{get;set;}
public string acc{get;set;}
public dependentcon
(ApexPages.StandardController controller)
{
}
public List<SelectOption> getaccounts()
{
List<SelectOption> optionList = new List<SelectOption>();
List<account> acc=[select id,name from account order by Name];
optionList.add(new SelectOption('','- None -'));
for (account fc :acc )
{
optionList.add(new SelectOption(fc.id,fc.name));
}
return optionList;
}
public List<SelectOption> getcontacts()
{
List<SelectOption> optionList = new List<SelectOption>();
Map<Id,Account> accts = new Map<Id,Account>([select name,(select name from contacts) from account]);
Set<Id> accountIds = accts.keySet();
system.debug('Find the value------>'+accts);
optionList.add(new SelectOption('','- None -'));
for(account cn :accountIds ) //Err line
{
optionList.add(new SelectOption(cn.id,cn.name));
}
return optionList;
}
}