Options

Limitation on Nested IF THEN ELSE statement in NAV 2016

DRBDRB 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?
-Dhan Raj Bansal
Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal

Answers

  • Options
    andrewtandrewt Member Posts: 73
    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.
  • Options
    DRBDRB Member Posts: 105
    @Andrewt, I know it is a bug but not feauture, but wrote FEATURE sarcastically !!!
    -Dhan Raj Bansal
    Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal
  • Options
    andrewtandrewt Member Posts: 73
    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.
  • Options
    Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    It is their subtle way of telling you to never even think about coding like this :)
  • Options
    BeliasBelias Member Posts: 2,998
    edited 2016-01-14
    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 :D)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.