You need to sign in to do that
Don't have an account?
Opportunity Line Item List
Below is a controller I have written to allow the update of OpportunityLineItem Quantity_Shipped__c with a VF page I have created. Please can someone help write a test for this.
public class OppLineListCon {
public PageReference cancel() {
Pagereference p = new Pagereference('/' + Apexpages.currentPage().getParameters().get('id')) ;
p.setRedirect(true);
return p;
}
public List<OpportunityLineItem> LineItems {
get {
LineItems = [select
TotalPrice,
UnitPrice,
Quantity,
PricebookEntry.Product2.Name,
PricebookEntry.Product2.Description,
Quantity_Shipped__c,
Description
from OpportunityLineItem
where OpportunityId = :Apexpages.currentPage().getParameters().get('id')];
return LineItems;
}
set;
}
public Pagereference save(){
Pagereference p = new Pagereference('/' + Apexpages.currentPage().getParameters().get('id')) ;
try {
update LineItems;
}
catch(System.DMLException e) {
ApexPages.addMessages(e);
system.debug(e);
return null;
}
p.setRedirect(true);
return p;
}
}
here is the code for the page