You need to sign in to do that
Don't have an account?
bingi crm 7
i am writting a wrapper class they showin bug i am write the instace of object wrapper1 but they are showing error
public class Displayprods1
{
public List<OpportunityLineItem> proList{get;set;}
public list<wrapper1> wrp{get;set;}
List<OpportunityLineItemwrapper> OppList = new List<OpportunityLineItemwrapper>();
public Displayprods1(ApexPages.StandardController controller)
{
}
public void populate(){
list<OpportunityLineItem > plist = [select id,Quantity,ListPrice,TotalPrice from OpportunityLineItem limit10];
for(OpportunityLineItem pr:plist){
wrapper1 w1 = new wrapper1();
w1.name = pr.name;
w1.Quantity = pr.Quantity;
w1.ListPrice = pr.ListPrice;
w1.TotalPrice = pr.TotalPrice;
wrp.add(w1);
}
}
}
-------------------------------------------------------------------
wrapper class
public class OpportunityLineItemwrapper
{
// all the line record instance create
public OpportunityLineItem pro{get; set;}
public string name {get;set;}
public integer Quantity {get;set;}
public decimal ListPrice {get;set;}
public decimal TotalPrice {get;set;}
public Boolean selected {get; set;}
public OpportunityLineItemwrapper() { name = ''; Quantity = 0 ; ListPrice = 0 ; TotalPrice = 0;
}
}
{
public List<OpportunityLineItem> proList{get;set;}
public list<wrapper1> wrp{get;set;}
List<OpportunityLineItemwrapper> OppList = new List<OpportunityLineItemwrapper>();
public Displayprods1(ApexPages.StandardController controller)
{
}
public void populate(){
list<OpportunityLineItem > plist = [select id,Quantity,ListPrice,TotalPrice from OpportunityLineItem limit10];
for(OpportunityLineItem pr:plist){
wrapper1 w1 = new wrapper1();
w1.name = pr.name;
w1.Quantity = pr.Quantity;
w1.ListPrice = pr.ListPrice;
w1.TotalPrice = pr.TotalPrice;
wrp.add(w1);
}
}
}
-------------------------------------------------------------------
wrapper class
public class OpportunityLineItemwrapper
{
// all the line record instance create
public OpportunityLineItem pro{get; set;}
public string name {get;set;}
public integer Quantity {get;set;}
public decimal ListPrice {get;set;}
public decimal TotalPrice {get;set;}
public Boolean selected {get; set;}
public OpportunityLineItemwrapper() { name = ''; Quantity = 0 ; ListPrice = 0 ; TotalPrice = 0;
}
}
Try to update your class like below
Let us know if this will help you
Thanks
Amit Chaudhary