Using the VAR tick on your function parameters

Greetings world.

Today, I came across a small feature of Microsoft Dynamics NAV which I had forgotten, and decided to share with the dev team over here at Technology Management.

The result of that, is the below sway presentation, which I thought you, the Dynamics NAV loving public might enjoy, though it’s a slightly different format to the norm. Do consider hitting the ‘full screen’ button if the layout is a tad cramped

Select your NAV module when starting the Powershell ISE

Those of you familiar with Powershell (and if you’re reading this, you’re interested in NAV & you’re remotely technical then you really should be) will know that the Powershell ISE is nearly always a superior environment. With scripting, Intellisense and the Commands explorer life could not be easier as a Powershell user – the commands are practically written for you.

But there has always been one shortcoming for me – writing ‘Import-Module’ every time I start a new instance of the environment. Even worse, having to potentially do so twice for NAV 2015.

But I have an answer for you all.

The more adventurous Powershell users out there are probably already with the concept of a profile script (details here)

I’ve been using this myself for a while now, but always found it irritating when I needed to administer on 2013/2013 R2, as I’d have to remove the auto-loaded 2015 modules & then import the appropriate NAVAdminTool. Now when I open Powershell I’m presented the following:

image

I press the button (or if I’m feeling particularly sumptuous I use keyboard shortcuts from the Alt key) and Powershell will import the modules for me.

In order to attain this for your own install of Powershell, you’ll need to copy the Powershell Script found in this zip file. Save this Powershell Script to

C:\Users\[your account name]\Documents\WindowsPowerShell

then open up Powershell & run the following command:

if (!(test-path $profile ))
{new-item -type file -path $profile -force

Now, whenever you open up the ISE you’ll be given the option to select which version of NAV module you require.

Microsoft Dynamics NAV 2013 NAS & Time Zones

Recently I had implemented changes at a customer which required the use of the Job Queue to run a process at 6AM every day & generate sales data.

As this is not an unusual request, I created the relevant report to run & generate the data, set up the job queue, added a new server instance for the NAS, tested the setup was working and informed the customer all was well and that the data would be generated each morning.

The first day, the data was generated at 6AM. Subsequent days saw the NAS job run at 7AM. Greatly puzzled by this I checked the Job Queue setup, the logs & the Job Queue codeunits to see if a reason for the change of time could be found. Unable to find a cause, I decided the change must have been human intervention, re-set for 6AM and left it to run again.

The next day, the job queue was set back to 7AM. Still unable to fathom why this may be I discussed the issue with my most esteemed colleagues (mostly in order to ensure I was not going mad). During the discussion a colleague reminded me that the clock on the terminal server was always ahead, which caused the issue to click – the server is setup in French, as we were implementing for the UK arm of a French company. Realising that the change in time could only be due to the NAS running in UTC, setting the time to 0600, and the server itself then converting the time to CET and adding the extra hour on. I poked further into the language settings & discovered in the NAV server instance the ‘Default Service Time Zone’ setting:

image

With this set to “Server Time Zone”, and a quick restart of the service the NAS was soon back to running on time.

It’s worth noting that this can also be set to a specific time zone as well, if required.