Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Very slow posting of sales invoices

Posted on by 32,675

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

  • Verified answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: Very slow posting of sales invoices

    it turned out that it was an ugly custom code for statistical purposes that ran crazy.

  • Verified answer
    Jens Glathe Profile Picture
    Jens Glathe 6,092 on at
    RE: Very slow posting of sales invoices

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans