Tuesday, October 25, 2016

SQL Server trial license expired on your cloud boxes for AX7?

If you have made deployments before summer, you might have deployments where the SQL Server is installed with a trial license and it is set to expire november 1st. When it expires you are not able to start the SQL Server service anymore.

Here are the necessary steps to update SQL Server:

  • Obtain a valid installation media and license. 
  • Stop the "Hyper-V Time Synchronization Service" service.
  • Change the system date on the server, to a date before the trial expiry date.
  • Run SQL Server installation and choose "Upgrade from preview version"
  • Start the "Hyper-V Time Synchronization Service" service again.

The reason for changing the system date is that the upgrade won't run if it can't start the existing SQL Server service.

Wednesday, October 5, 2016

Why you can't find any delete actions for the DocuRef table in AX7

There aren't any...

In AX7 clean up of records in DocuRef is handled by a recurring batch job. The batch job is automatically created during AX initialization when you deploy a new solution. The batch job is listed as "Scan for orphaned document references" and it is scheduled to run every sixth hour.

I can't find the job between the batch jobs in the demo data though. But you can add it by calling the loadData method of the class DocumentManagementSetup.

Thursday, September 29, 2016

Setup a keyboard shortcut on the WMS mobile device portal

You can setup keyboard shortcuts for the mobile device portal without any code changes at all. Here is in short what you need to do.

You need to know two things before you can setup the shortcut:

  1. The HTML id of the button type to create the shortcut for.
  2. The JavaScript keyboard code for the key you want to use.
You find the HTML id of the button type by looking at the HTML source behind it. In Internet Explorer you right click a button of the type and select "Inspect element":

Then you can find the HTML id here:

The JavaScript keyboard code you can find from this menu item (sorry, the screenshot is in Danish, but it should say something like "Show codes for keyboard short cuts"):

When you have clicked the menu item, just hit the key you want to use and it will show the keyboard code:

Here I have hit the escape key and got code 27 for that.

Now you need to decide how to show what the keyboard shortcut is shown as. That is added to text of the button. In this case I'll show it as "ESC".

To enable the escape button  for "Cancel", I can enter the following setup in "Work user mobile display settings":
So this is "HTML id"("text to show in the button")="keyboard code"

And it'll look like this:

Here is a good article from Microsoft explaining the setup:

Friday, September 2, 2016

The Microsoft Dynamics AX Help Wiki is getting a lot of good content these days

The last few days and weeks a lot of good documentation has been added to the Wiki. If you want to follow new articles you should subscribe to the RSS feed.

And by the way, a lot of the X++ documentation also applies to older versions than AX7.

Friday, August 12, 2016

Don't change the name of a Form instance in AX 7

In AX 2012 you could do something like this, where you change the name of a Form instance:

form = new Form(formstr(MyPrettyForm));"AnotherNameToConfuseEverybody);

args = new Args();

formRun = classfactory.formRunClass(args);

In AX 7 changing the name seems to confuse AX to a sense where it can't figure out to actually run eventual code in (at least) the init and run methods of the form.

For many reasons I think it is a poor idea to change the name of a form instance, now there is also a technical reason not do it.