You need to sign in to do that
Don't have an account?
Amit Jadhav 13
Error: costsheet Compile Error: Constructor not defined: [cost sheet.Wrapper].<Constructor>(Opportunity, Order) at line 17 column 45
This is Apex Class
public with sharing class costsheet {
public costsheet(ApexPages.StandardController controller) {
}
public List<Order> ordwrap = new List<Order>();
public List<Opportunity> oppwrap = new List<Opportunity>();
public costsheet()
{
this.SOWrappers = new List<SOWrapper>();
ordwrap=[Select id,Cost_Price_As_per_Allocation__r.CI__c from Order];
oppwrap=[select Id,name,Account.Name from opportunity];
for(opportunity opp:oppwrap){
for(Order ord: ordwrap){
If(opp.id == ord.id)
{
SOWrapper wrapper = new SOWrapper(opp, ord);
this.SOWrappers.add(wrapper);
}
}
}
}
public List<SOWrapper> SOWrappers{get;set;}
public class SOWrapper{
public Order order{get;set;}
public Opportunity opportunity{get;set;}
public Cost_Price__c costprice{get;set;}
public SOWrapper(Order ord, Opportunity opp,Cost_Price__c cp){
order= ord;
opportunity = opp;
costprice = cp;
}
}
}
public with sharing class costsheet {
public costsheet(ApexPages.StandardController controller) {
}
public List<Order> ordwrap = new List<Order>();
public List<Opportunity> oppwrap = new List<Opportunity>();
public costsheet()
{
this.SOWrappers = new List<SOWrapper>();
ordwrap=[Select id,Cost_Price_As_per_Allocation__r.CI__c from Order];
oppwrap=[select Id,name,Account.Name from opportunity];
for(opportunity opp:oppwrap){
for(Order ord: ordwrap){
If(opp.id == ord.id)
{
SOWrapper wrapper = new SOWrapper(opp, ord);
this.SOWrappers.add(wrapper);
}
}
}
}
public List<SOWrapper> SOWrappers{get;set;}
public class SOWrapper{
public Order order{get;set;}
public Opportunity opportunity{get;set;}
public Cost_Price__c costprice{get;set;}
public SOWrapper(Order ord, Opportunity opp,Cost_Price__c cp){
order= ord;
opportunity = opp;
costprice = cp;
}
}
}
the constructor will accept the Order, Opportunity and Cost Price objects