Monday, 24 October 2016

Referencing a form control [AX7]

I am seeing this a lot more these days because of extensions in AX7. You tend to take the form run in the event and try to get a form control.

A lot of developers seem to be hard coding the control name. Not wrong but not the best way to do it. A form control name could change or be deleted. Then you wont catch this until a user runs it.

Not so good way:“MyControlName”);

The right way:, MyControlName));

This way you get your errors during compile time.

Monday, 10 October 2016

Install an application x++ hotfix [AX7]

Microsoft has document this well on the wiki but can be confusing for first time. Also, things are improving and sometimes hard to keep up.

This is what you see on LCS when updates are available.


This wiki page walks you through the steps for applying a Microsoft Dynamics AX deployable package on a Dynamics AX system. This package can be either a binary hotfix for Application Object Server (AOS) or a deployable package that was created in your development environment.

Apply a deployable package on a Dynamics AX system

The most misunderstood part is the application x++ updates. What you are downloading from LCS is the x++ code. You are not downloading a deployable packages. A deployable package is a compile output that you can use to install to your none development machines.

Below link guides you how to install it.

Install a metadata hotfix

Below is how you do it using the visual studio addin rather than command line. Saves you a bit of time.

Click on Addins > Apply Hotfix


It defaults the parameters but you have to browse and select your file.


Visual studio will try to process. You can see Task manager to see that it has kicked it off.


It may take a few minutes but you will get a message.


Check that it has been applied.



  • Addins can change at any time. So, learn the proper way from the Microsoft Wikis. Know what it is doing.
  • You can create your own addins to improve tooling. That is why Visual studio is so great.

Friday, 7 October 2016

Change password of web config file [AX 7]

It is good practice to change the Administrator password. You might want to be extra secure and also change the other accounts (service accounts).

You will notice that the web config file is encrypted when it comes to passwords.


You can use the following commands to encrypt/decrypt the file.


To decrypt run this command:

C:\AOSService\webroot\bin\Microsoft.Dynamics.AX.Framework.ConfigEncryptor.exe -decrypt C:\AOSService\webroot\web.config

To encrypt run this command:

C:\AOSService\webroot\bin\Microsoft.Dynamics.AX.Framework.ConfigEncryptor.exe -encrypt C:\AOSService\webroot\web.config


If you make changes you may need to reboot the machine. Restarting IIS didnt work for me when I changed the passwords.

Wednesday, 5 October 2016

Schedule Azure machines on and off

I friend of mine recommended this cool tool for scheduling machines on Azure. This is really good for saving Azure credit. You can schedule to turn on a machine before you start work and turn it off after work. Make sure it turns off over the week, incase you have forgotten.

Here is how simple it is. Connect up and select your machine. Then schedule.



Plus they have a FREE plan.

Saturday, 1 October 2016

Payment advice in AX7

Payment advice has now been added to the Print management setup now. This is a nice addition.


New button under the payment journal lines form. Payment advice button is only enabled if the Payment status is sent.


Dialog populates with the Vendor and Bank but you can clear it out to run for all lines.


Payment advice report on screen.


AX calling Microsoft Flow

This is a continuation from the previous post. In the previous post, I wrote about using Azure Logic (big brother of Flow).

This is just to let you know that Microsoft Flow has released the Request feature. So the same can be done via Flow.

September update is a big one

Friday, 16 September 2016

Azure Logic with AX–callable endpoint

There are lots of ways to work with Azure Logic. This will be my first of many hopefully to show you how you can use Azure Logic with AX.

Have a read of this post from the Azure Logic team first. It explains how you can create a callable endpoint in Azure Logic.

Logic apps as callable endpoints

In my post I will show you how you can use AX to call an Azure Logic endpoint.

SNAGHTML2b98aec (I am not a graphics guy but the little fire on the end of the rocket is my addition)

First start by writing a job that sends a post message to request bin. Request bin is a good site which you can use to send a message to it and it displays the results in a readable way.

Navigate to request bin and copy the URL into the job. Then run the job to see the result.

static void _jsonJob(Args _args)
    RetailWebRequest    request;
    RetailWebResponse   response;
    str                 rawResponse;
    Map                 data;
    RetailCommonWebAPI  webApi = RetailCommonWebAPI::construct();

    str _requestUrl = @'';
    //str _requestUrl = @';
    str _postData =
            "email": "",
            "name": "Munib A Ahmed"
    str _header = '';
    str _contentType = 'application/json';

    response = webApi.makePostRequest(_requestUrl, _postData, _header, _contentType);

    rawResponse = response.parmData();
    data = RetailCommonWebAPI::getMapFromJsonString(rawResponse);

Below is what you should see in request bin.


Now, lets do it via Azure Logic.

1) In Azure Logic create a new app




3) Create a HTTP request. This will give you a URL which you can call.


Use to copy your message and get a schema. This schema can be pasted into the HTTP request.


I create an action to send an custom response. I added parts of my request and some additional elements.

Run the job in AX and have a look at the response.


This is just a quick test but think of similar examples. You can possibly create a framework in AX where you send a message after an invoice is posted. That message could be json, string, xml or filestream. Then you can have Azure Logic send an SMS, email, integrate with SalesForce/CRM or all other connectors.