One of the cases that makes last direct cost updates in Item card from system; Is when we do positive entry from Item Journal line;
We need to stop updating the Last direct cost that comes from positive entries .
I went to code unit 22 -----> to UpdateUnitCost(ValueEntry : Record “Value Entry”) → and put comment down on the yellow color if the entry type is in Positive Adjmt -------> is this enough ? As i tried and test it worked fine but i need to know your comments or warnings about this change … thank you
CODEUNIT 22
UpdateUnitCost(ValueEntry : Record “Value Entry”)
WITH ValueEntry DO BEGIN
IF (“Valued Quantity” > 0) AND NOT (“Expected Cost” OR ItemJnlLine.Adjustment) THEN BEGIN
Item.LOCKTABLE;
IF NOT Item.FIND THEN
EXIT;
IF (“Item Ledger Entry Type” IN
[“Item Ledger Entry Type”::Purchase,
// “Item Ledger Entry Type”::“Positive Adjmt.”,
“Item Ledger Entry Type”::Output]) AND
(“Cost Amount (Actual)” + “Discount Amount” > 0) AND
(ItemJnlLine.“Value Entry Type” = ItemJnlLine.“Value Entry Type”::“Direct Cost”) AND
Last direct cost is basically a default purchase price so I don’t see any problem in your change if your not worried with the price of the item journal
Please Rashed if i am wrong correct me … And please tell me if i need still too put IF statemnet … For me it 's first time to update in such coding in navision