This documentation is archived and is not being maintained.
PurchCalcItemLine.calcCost Method [AX 2012]
Calculates the cost of the line.
protected boolean calcCost(Qty _consumptionInventQty, [boolean _calcTradeAgreements])
Run On
Called
Parameters
-
_consumptionInventQty
- Type: Qty Extended Data Type
The consumed quantity.
-
_calcTradeAgreements
- Type: boolean
A Boolean value that indicates whether the trade agreements should be considered.
Return Value
Type:
boolean
true if the cost has been calculated; otherwise, false.
| Exception | Condition |
|
Error
|
The line is not embedded in a purchase cost calculation object.
-or-
The wrong cost calculation has been initialized and the PurchCalcItemLine object expects a PurchCalcCost object for the cost calculation.
|
The method will return false if the cost will be calculated based on trade agreements.
The consumed quantity will be added to the parent calculation and the cost will be calculated at the end.