All around NAV dev and test
All good things come in threes, as they say. So here is 3.
Codeunit 50000:OnRun()ShipMethod.INIT;ShipMethod.INSERT;ShipMethod.INSERT; // This duplicate statement has been put here intentionally
Codeunit 50001:OnRun()IF CODEUNIT.RUN(50000) THEN MESSAGE('OK')ELSE MESSAGE('LASTERRORTEXT: %1', GETLASTERRORTEXT);
First "from the bare head", but test it in NAV! Both in classic and RTC. For the latter:
Variable ShipMethod in codeunit 50000 is linked to the Shipment Method table (10).
There has been quite some fuzz about the NAV 2013 partner licenses. Especially about the missing ISV Insert Rights. On one of my previous posts Gary Winter commented that this omission was "a bug in the licensing tool that does not allow partners to download a 2013 license with insert rights."
Since then I have been checking VOICE frequently to see if the bug was fixed already, but to no avail. Apparently I did not check for some weeks until today to find out that it has been fixed so that the ISV Insert Rights can now be configured for your partner license.
Just to spread the news I am copying Simon Ejsing's announcement on mibuso:
This last item in my NAV2013 Beta to RTM - Some Striking Code Changes series is addressing code changes NAV core team made to get IF-THEN-ELSE statements coding standards compliant.
If you read the Microsoft Dynamics NAV 2009 Developer and IT Pro Documentation on IF-THEN-ELSE, and also on the use of parentheses, you'll notice that there are quite some conventions to take into account. Quite some to violate, isn't it?
Let's take some exemplar code changes that underline these conventions. It think it's a good way to refresh your coding standards knowledge, like most of the previous posts in this series could have done that somehow.
Click on the image to get a full view that's readable.
Click on the images to get a full view that's readable.
This also applies to the DO part of a WHILE-DO statement
I.e. do not use redundant parentheses.
This also applies to WHILE-DO and CASE statements
Although the coding standards are unambiguous about the layout of CASE statements, there has always been practiced an alternative flavor. Both within MS and outside.
This is the standard syntax:
CASE <Expression> OF
<Value set 1>:
<Value set 2>:
<Value set n>:
And this is the alternative flavor:
CASE <Expression> OF
<Value set 1>: <Statement 1>;
<Value set 2>: <Statement 2>;
<Value set n>: <Statement n>;
However, as said, the coding standards are unambiguous about the layout stating:
The action [i.e. the statement - lvanvugt] starts on the line after the value set and is further indented by two character spaces.
Meaning that the alternative flavor is not part of these standards and now with NAV 2013 you could say that has been confirmed by means of the code cleanup performed between Beta and RTM, where all alternative layouts have been revised and changed to the standard layout.
The alternative is more compact, but the standard is more clear in displaying the 'available' value sets.
Found another nice example: