Customer/Vendor ledger entry wrong Amount, Remaining Amount in NAV 2015

It has been noted as a  bug in NAV 2015 where Customer/Vendor Ledger Amount, Amount(LCY), Remaining Amount and Remaining Amount(LCY) flowfields are calculated wrongly. This case only if there is adjustments posted for foreign currencies.

With NAV 2015 you might have noted that these flowfield calculation formula is bit different.

Vendor Ledger entry Amount(LCY) flowfield calculation in

Older than NAV 2015 version

Sum(“Detailed Vendor Ledg. Entry”.”Amount (LCY)”WHERE (Vendor Ledger Entry No.=FIELD(Entry No.),Entry Type=FILTER(Initial Entry|Unrealized Loss|Unrealized Gain|Realized Loss|Realized Gain|Payment                 Discount|’Payment Discount (VAT Excl.)’|’Payment Discount (VAT Adjustment)’|Payment Tolerance|Payment Discount     Tolerance|’Payment Tolerance (VAT Excl.)’|’Payment Tolerance (VAT Adjustment)’|’Payment Discount Tolerance (VAT Excl.)’|’Payment Discount Tolerance (VAT Adjustment)’),Posting Date=FIELD(Date Filter)))

NAV 2015

Sum(“Detailed Vendor Ledg. Entry”.”Amount (LCY)” WHERE (Ledger Entry Amount=CONST(Yes),Vendor Ledger Entry No.=FIELD(Entry No.),Posting Date=FIELD(Date Filter)))

With NAV 2015, Microsoft added a new field in Detailed Customer/Vendor Ledger entry tables,Field ID – 43 “Ledger Entry Amount” (Boolean). This field is updated on onInsert of Detailed Cust. Ledg. Entry and Detailed Vendor Ledg. Entry. Except for entry type “Application” or “Appln. Rounding”, this new fields is updated true.

But then posting Exchange rate adjustments this new field is not getting updated, even through entry type for the exchange rate adjustment entries will be one of these, Unrealized Loss,Unrealized Gain,Realized Loss,Realized Gain.

To Fix this wrong calculation

  • Amend Report 595 – Adjust Exchange Rates. Function – HandlePostAdjmt

Search for DtldCustLedgEntry.INSERT; replace it as DtldCustLedgEntry.INSERT(true);

Search for DtldVendLedgEntry.INSERT; replace it as DtldVendLedgEntry.INSERT(true);


  • Patch Ledger Entry Amount field in existing Detailed Ledger records