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

Wrapper class_example
public class wrapper_on_account
{
List<wrapperaccount1> wrapaccount=new List<wrapperaccount1>();
List<account> selectedaccountlst=new List<account>();
public List<wrapperaccount1> getAccounts()
{
for(Account a :[select Id, Name, AccountNumber, Phone from Account limit 5])
wrapaccount.add(new wrapperaccount1(a));{I need Explination for this line}
//How it works
return wrapaccount;
}
{
List<wrapperaccount1> wrapaccount=new List<wrapperaccount1>();
List<account> selectedaccountlst=new List<account>();
public List<wrapperaccount1> getAccounts()
{
for(Account a :[select Id, Name, AccountNumber, Phone from Account limit 5])
wrapaccount.add(new wrapperaccount1(a));{I need Explination for this line}
//How it works
return wrapaccount;
}
Please check below post for Wrapper class demo
1) http://amitsalesforce.blogspot.com/2016/03/wrapper-class-in-salesforce-select-all.html
Problem :-
How can I display a table of records with a check box and then process only the records that are selected?
Solution:-
Wrapper class.
A wrapper or container class is a class, data structure, or an abstract data type whose instances are a collections of other objects.It is a custom object defined by Salesforce developer where he defines the properties of the wrapper class. Within Apex & Visualforce this can be extremely helpful to achieve many business scenarios within the Salesforce CRM software.
Please let us know if this will help you