Category Archives: Historic NAV

Anti Pattern – TODAY function

One of the oldest features in C/AL and the AL code before that is the TODAY function. It will return the current date from the local computer.

A close friend of TODAY is WORKINGDATE. Working Date is the concept of setting “today” to be something else.

When working with entering data, the ease of type t in a date field for today, and w for working date are good for entering data.

But what about when you’re using TODAY (or WORKINGDATE) in your code?

Yesterday I came across an example in one of our old products:

IF CALCDATE('CM+1D',DueDate) > TODAY THEN
    PostSomething()
ELSE
    PostSomethingElse();

Depending on the current date when the user pressed Post, different things would be posted.

It got me thinking, when is the use of TODAY appropriate in code?

The first valid use case would be to add a timestamp to records, field like “Modified Date, “Created Date”, “Approved Date”. Fields where you are recording the date of a user action.

In most other cases, you should use WORKINGDATE to give your users a chance to control the flow. And if actions in your code depend on Dates – let the user know about this.

Do you have other examples of the bad or good use of TODAY?

Export NAV license from SQL Server

Microsoft Dynamics NAV does not give you an easy an option to export the NAV license from a SQL Server.

exportlicense1

You can upload to the server, or temporary change the license that is used in the development client, but you cannot download it again. Usually, that is not a big deal, you got your license file anyway, but in some cases, its practical to be able to export the license.

With NAV, the license can be placed in two different places, in the master database or in separate databases.

exportlicense3

If you check the “Save license in database”, the licens goes into the database, otherwise its stored on the server.

Introducing a simple tool to perform the export

exportlicense2

This tools will export the license file from the SQL server and database specified. If you leave the database field empty, the tools will export the license stored in the master database.

Download from here: ExportLicense

(13/2/2016: Updated to better handle SQL servers with different collations)

Or grab the source from github:
https://github.com/hougaard/ExportLicense

Microsoft Dynamics NAV and Windows 10

So July 29 2015 is the big day for Windows 10.  I have tested all the versions of NAV I have available on Windows 10 and the list is basically the same as with Windows 8.

The first version I tried was “Navision 3.56a” – The character based predecessor to Microsoft Dynamics NAV.

navi356

That worked fine (With the NAVIN.EXE executable).

After this, Financials 1.30 was up, but a rather disappointing result. FIN.EXE does not start, it ask for elevated permissions, and the bombs out.

windows10-fin260

The same things happens for:

Financials 2.00
Financials 2.60
Attain 3.01
Microsoft MBS Navision 4.00sp3

The oldest version that works with Windows 10 is:

Microsoft Dynamics NAV 5.0

windows10-nav50

This is not really a surprise, since Windows Vista, Windows 7 and Windows 8 had the same problem. But after the Windows 10 team showed that even Microsoft Office 95 worked on Windows 10, I had my hope up for the select few that still runs Financials 2.60 and therefor have to stay on XP for now.

Anyway, the rest just works, 2009, 2009SP1, 2009R2, 2013, 2013R2, 2015 and the beta of NAV2016 also works fine on Windows 10.

windows10-nav2016