Limitation on Nested IF THEN ELSE statement in NAV 2016
DRB
Member Posts: 105
Hi,
Interesting observation related to NAV 2016:
Seems there is limitation on Nested IF THEN ELSE statement, you can do upto 35 cases and if done on 36th case then NAV crashes while compiling the object.
Although there was no such limitation upto NAV 2015. I know one should use CASE OF statement in such scenarios, but this issue initially appeared little weird.
Did anyone else also faced this issue and is it documented FEATURE in NAV 2016?
Interesting observation related to NAV 2016:
Seems there is limitation on Nested IF THEN ELSE statement, you can do upto 35 cases and if done on 36th case then NAV crashes while compiling the object.
Although there was no such limitation upto NAV 2015. I know one should use CASE OF statement in such scenarios, but this issue initially appeared little weird.
Did anyone else also faced this issue and is it documented FEATURE in NAV 2016?
-Dhan Raj Bansal
Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal
Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal
0
Answers
-
Although crashing the client doesn't sound like a documented feature but more like a bug, you should take 'Cyclomatic Complexity' into account on your dev tasks anyhow.
This has been focused as a design pattern by Microsoft since the release of NAV 2015 and has been implemented as a general design guideline which should be followed by us as developers.
https://community.dynamics.com/nav/w/designpatterns/175.cyclomatic-complexity
Cheers
Andrew T.0 -
@Andrewt, I know it is a bug but not feauture, but wrote FEATURE sarcastically !!!-Dhan Raj Bansal
Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal0 -
I know you know so we both missed to use
, don't we ?
Anyhow, my comments regarding 'Cyclomatic Complexity' (oh man, I love this term...) were genuine, so although it seems to be a bug (haven't yet verified by myself) it seems to be more theoretical as we wouldn't get there as long as we follow these reasonable design patterns and guidelines.
Cheers
Andrew T.0 -
It is their subtle way of telling you to never even think about coding like this
0 -
Moreover...there's nothing more crashy than nav2016 development environment
(but for sure, the point is: "why in the heck there are 36 IFs? O.o i'd like to see them indented in nav 2009
) 0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 329 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