Hi all!
Please help me to solve the problem. Navision uses "Inventory Adjustment Account" field (table 252 - General Posting Setup) during posting inventory adjustments (positive and negative). I want to change this, I need that program must use another field in different table.
In cu5802 (Inventory Posting To G/L) I found this.
SetAccNo(VAR GenJnlLine : Record "Gen. Journal Line";InvtPostBuf : Record "Invt. Posting Buffer") WITH InvtPostBuf DO BEGIN IF UseInvtPostSetup(InvtPostBuf) THEN InvtPostSetup.GET("Posting Group 1","Posting Group 2") ELSE GenPostingSetup.GET("Posting Group 1","Posting Group 2"); ..... ..... "Account Type"::"Inventory Adjmt.": BEGIN GenPostingSetup.TESTFIELD("Inventory Adjmt. Account"); GenJnlLine."Account No." := GenPostingSetup."Inventory Adjmt. Account"; END; ..... .....
SetAccNo(VAR GenJnlLine : Record "Gen. Journal Line";InvtPostBuf : Record "Invt. Posting Buffer")
WITH InvtPostBuf DO BEGIN
IF UseInvtPostSetup(InvtPostBuf) THEN
InvtPostSetup.GET("Posting Group 1","Posting Group 2")
ELSE
GenPostingSetup.GET("Posting Group 1","Posting Group 2");
..... .....
"Account Type"::"Inventory Adjmt.":
BEGIN
GenPostingSetup.TESTFIELD("Inventory Adjmt. Account");
GenJnlLine."Account No." := GenPostingSetup."Inventory Adjmt. Account";
END;
but simple replacement of the value doesn't work.
Forst explain why you need to do this? It apears that you would have accounts out of balance if you did this, and maybe you just have the posting groups setup wrongly.
The only time I have ever had to change the accounts like you are suggestion was prior to version 3.00, when inventory posting group setup did not exist, and I had clients that needed the functionality that is now available as standard in NAV.