Public realI have a method to calculate the total consumption cost based on a production ID:
getTotalConsumptionCost(ProdId _prodId)
{
ProdJournalBOM prodJournlBOM;
real totalCost = 0;
select sum(ConsCost) from prodJournlBOM
where prodJournlBOM.ProdId == _prodId;
totalCost = prodJournlBOM.ConsCost;
return totalCost;
}
Where should I place the logic to calculate and update line-level data based on header information in AX 2012 R3?Should this logic be placed in the header table or the lines table?
I want to ensure that the calculated value is accurate and up-to-date for each line.