You need to sign in to do that
Don't have an account?
can any one explain me
see below some code of wrapper class
public void ProcessSelected(){
selectedAccounts=new list<account>();
for(wrapaccount wrapobj:wrapaccountlist){ if(wrapobj.isSelected==true){
selectedAccounts.add(wrapobj.accn);
}
}
}
public class wrapaccount{
public account accn{get;set;}
public boolean isSelected{get;set;}
public wrapaccount(account a){
accn=a;
isselected=false;
}
}
}
it is not full code , so my question is
selectedAccounts.add(wrapobj.accn);
in above codeLine why we did this wrapobj.accn
can any one answer me .
Thank You
public void ProcessSelected(){
selectedAccounts=new list<account>();
for(wrapaccount wrapobj:wrapaccountlist){ if(wrapobj.isSelected==true){
selectedAccounts.add(wrapobj.accn);
}
}
}
public class wrapaccount{
public account accn{get;set;}
public boolean isSelected{get;set;}
public wrapaccount(account a){
accn=a;
isselected=false;
}
}
}
it is not full code , so my question is
selectedAccounts.add(wrapobj.accn);
in above codeLine why we did this wrapobj.accn
can any one answer me .
Thank You
I have gone through your query. So, when we create a Wrapper class then we have to make its instance to access its variables. Like here you have created a wrapper class and variables in it. So to access these variables we create an instance(wrapob) of class(wrapaccount) so you can access variables using this.
https://www.pebibits.com/wrapper-classes-in-apex/
Hope this explanation will resolve your query. Mark it as the best answer if you find it helpful.
Thanks
Akshay