hi,
how can i find out what's the reason is why the posting of sales invoices are gone very slow depending on the nr of sales lines. it can last up to 20min per posting! we have made a performance tracing of the posting using sql profiler. it resulted out, that one statement is run over 3.000.000 times during posting:
SELECT TOP 1 Null FROM "dbo"."Value Entry" WITH (UPDLOCK, ROWLOCK)
WHERE (("Item Ledger Entry No_"=10000)) AND (("Item Charge No_"<>''))
how can i found out whats the according c/al code and where to find it. unfortunately it's a Nav 4.0 and there are no OMA Tools to check (where used, ...).
*This post is locked for comments
it turned out that it was an ugly custom code for statistical purposes that ran crazy.
Hi Jonathan,
you could use the client monitor and enable trace SQL statements. But to make this short: "Select Top 1 NULL" is most probably an ISEMPTY statement in NAV. I would start my search in CU22.
However this got me curious: I found this blog entry here. www.navision-blog.de/.../navision-performance-optimierung-auf-dem-sql-server
For the search, I would look to Stati-Cal PRISM. It is pretty useful. Regarding the probable cause: 3M Entries sound like an awful lot. Something recursive perhaps? Is it always the same item ledger entry no. ? Hmm... a search on setfilter("Item Charge No.".'<>%1','') ? This finds only 4 occasions in the whole NAV4.0 code - all in CU5813..5816, "Undo Shipment" type, in function CheckSalesShptLine()... any chance that this gets called on a sales posting? There is no link to it... The interesting part, however, is that this structure (do an isempty on value entry for item ledger entry no., with an item charge) should be fairly seldom.
with best regards
Jens
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,232 Super User 2024 Season 2
Martin Dráb 230,064 Most Valuable Professional
nmaenpaa 101,156