FINDFIRST used with REPEAT in posting routines in NAV 2017

piktaz
Member Posts: 10
Hi,
I came across this code in the Sales-Post codeunit in NAV 2017

Couldn't believe what I see so checked the Purch.-Post codeunit and it was exactly the same, FINDFIRST accompanied by REPEAT loop.
I checked the documentation (NAV 2016) and it still explicitly says FINDFIRST should never be used in combination with REPEAT UNTIL.
Has something changed in NAV 2017 regarding this?
Thanks
I came across this code in the Sales-Post codeunit in NAV 2017

Couldn't believe what I see so checked the Purch.-Post codeunit and it was exactly the same, FINDFIRST accompanied by REPEAT loop.
I checked the documentation (NAV 2016) and it still explicitly says FINDFIRST should never be used in combination with REPEAT UNTIL.
Has something changed in NAV 2017 regarding this?
Thanks
0
Answers
-
At first I thought it was because the GetNextSalesLine() function was doing something funky but it's not really - it goes through all the sales lines until NEXT returns 0 and then does and extra loop for posting a prepayment line.
In my mind there's no valid reason that this shouldn't be a FINDSET.0 -
Yep, my initial thoughts were GetNextSalesLine() was doing something sophisticated. But reality is it just a glorified Record.NEXT fetch function.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