You need to sign in to do that
Don't have an account?
Custom shopping cart page apex code problem
I am trying to edit this code so when I add a product it will add 2 custom fileds to the opprtuinty line item. " A formula field on Price book entery "Type_c" =Text (Product2.Product_Type__c) and a check box "Needs_Approval__c" I can't seem to get it added with out an error.
public void addToShoppingCart(){
// This function runs when a user hits "select" button next to a product
for(PricebookEntry d : AvailableProducts){
if((String)d.Id==toSelect){
shoppingCart.add(new opportunityLineItem(OpportunityId=theOpp.Id, PriceBookEntry=d, PriceBookEntryId=d.Id, UnitPrice=d.UnitPrice, ));
break;
}
}
updateAvailableList();
}
public void addToShoppingCart(){
// This function runs when a user hits "select" button next to a product
for(PricebookEntry d : AvailableProducts){
if((String)d.Id==toSelect){
shoppingCart.add(new opportunityLineItem(OpportunityId=theOpp.Id, PriceBookEntry=d, PriceBookEntryId=d.Id, UnitPrice=d.UnitPrice, ));
break;
}
}
updateAvailableList();
}
All Answers
Shaijan