public class accountExtension{
public List<Account> accountList{get;set;}
public accountExtension(ApexPages.StandardController controller){
accountList = [SELECT id ,Name FROM Account];
}
public boolean activeAccountOnly{get;set;}
public void showActiveAccounts(){
accountList = new List<myWrapperClass>();
normalList = false;
selectedList = true;
if(activeAccountOnly == false)
{
accountList = [SELECT id ,Name FROM Account WHERE is_active__C =TRUE];
}else{
accountList = [SELECT id ,Name FROM Account];
}
}
}
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
Below is the sample code with checkbox as active,refer and change according to your requirement.
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
Best Regards
Sandhya
Error: accountExtension Compile Error: Illegal assignment from List<Account> to List<Account> at line 4 column 9