Working with NAV 2009.
I have a query on Item ledger entry which is slow.
It seems, that the first 2 iterations take a lot of time (about 1 minute), but after that it is fast (within the second).
The code I use:
ILE.RESET;
ILE.SETRANGE(ILE."Item No.", "Item No.");
ILE.SETRANGE(ILE.Open, TRUE);
ILE.SETCURRENTKEY("Item No.",Open,"Variant Code","Location Code","Item Tracking","Lot No.","Serial No.");
IF ILE.FINDSET
THEN REPEAT
<create temp table records>
UNTIL (ILE.NEXT = 0);
When I close the program and reopen it there is no delay. But when Navision is closed and reopened the same problems pops up.
0
Answers
How many enties, on average, are you expecting to copy to temp table in your loop?
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Yury