You need to sign in to do that
Don't have an account?
randombard
Multiplying UnitPrice to match agreed increase.
Hi All,
how would I multiply the unitprice on an opportuniy line item by another field value.
IF(PE.Product2Id == OL.PricebookEntry.Product2Id){ NOL = New OpportunityLineItem(); NOL.Opportunityid = op.id; NOL.PricebookEntryId = PE.id; NOL.Quantity = OL.Quantity; NOL.UnitPrice = OL.UnitPrice * IncPer; NLI.add(NOL); } }
I get
Error: Arithmetic expressions must use numeric arguments
Is this because Incper is:
String IncPer = '1.' + o.account.Agreed_price_Increase__c;
In this example IncPer returns 1.10
R
Try casting first.
Decimal IncPerAsDec = decimal.valueOf(IncPer);