ExistingExpirationDateAndQty Function

Belias
Member Posts: 2,998
the function in object, present in codeunit 6500, there's a major threat in performance, if you use the tracking module. Here's the old code (with a lot of data, a single reclassification journal line could post in 20-30 seconds O.o)
here's how i modified it:
I'm wondering why it wasn't done in "my" way...any idea? Am I missing something, maybe?
IF ItemLedgEntry.FINDSET THEN REPEAT SumOfEntries += ItemLedgEntry."Remaining Quantity"; UNTIL ItemLedgEntry.NEXT = 0;
here's how i modified it:
ItemLedgEntry.CALCSUMS("Remaining Quantity"); SumOfEntries := ItemLedgEntry."Remaining Quantity"; //IF ItemLedgEntry.FINDSET THEN //REPEAT // SumOfEntries += ItemLedgEntry."Remaining Quantity"; //UNTIL ItemLedgEntry.NEXT = 0;
I'm wondering why it wasn't done in "my" way...any idea? Am I missing something, maybe?
0
Comments
-
Hi Belias,
It will work fine on an SQL database but on a C/SIDE database you will get an error that you must select the right key.Reijer Molenaar
Object Manager0 -
for sure, that may be the reason (not tested, but i trust you because that key does not have the sumindex for remaining qty)
...
anyway..the performance boost is so freakin' huge that they should have done a RECORDLEVELLOCKING switch for it, at least...0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions