Purchase pages not showing totals

sylvainroysylvainroy Member Posts: 12
I recently came across an issue with NAV 2016 where the totals under the PO invoice line were 0 even though there were lines in the invoice.

I found out that the problem was in codeunit 57 in function PurchaseCheckNumberOfLinesLimit :

PurchaseCheckNumberOfLinesLimit(PurchaseHeader : Record "Purchase Header") : Boolean
PurchaseLine.SETRANGE("Document No.",PurchaseHeader."No.");
PurchaseLine.SETRANGE("Document Type",PurchaseHeader."Document Type");
PurchaseLine.SETFILTER(Type,'<>%1',PurchaseLine.Type::" ");

EXIT(PurchaseLine.COUNT <= 100);

No error, no message, nothing but the link to refresh the totals at the bottom of the subpage... Changing the <= 100 to something bigger made it. Thought I'd share this if you have a similar issue.


  • KishormKishorm Member Posts: 921
    The reason for this is performance, the more lines you have the more time it takes to calculate the totals. However, Microsoft should have used a new setup field to hold the cutoff point instead of hardcoding it in my opinion.
  • mgnmgn Member Posts: 39
    edited 2018-10-01
    We ran into the same issue and are amazed about this 'shortcut' taken by the MS dev team.
Sign In or Register to comment.