3 min read

Dynamics AX - Hello World

If you are starting now with Dynamics AX, or you want to make developments in the new platform, the first thing that you will want to do, like in any other language is to start with a simple “Hello World” class. Its primary purpose is to ensure that compiler is in the path, the libraries are in the right place and the build script is sane.

When configuring a new environment or coming to an unknown environment, verifying that “Hello World” behaves correctly should be the first step.

The first thing you need do is, of course to start Visual Studio (don’t forget to start it as an Administrator )

Go to the Dynamics AX-> Model Management -> Create model
Creating a model is a way to isolate and manage the customisations you do.

Fill out the fields as appropriate

Click Next, select Existing package and choose Application Suite

Click Next and then Finish

A new window will appear that will ask you to save the new project. Select Dynamics AX Project, give it a name and press OK

Now, let’s add the hello world class. In the Solution Explorer window, right click on the project -> Add -> New Item

Click on Code and select Runnable Class (Job) . Give it a name and press Add

Double Click on the class and write info(“Hello World”). Your class should look like:

class RunnableHelloWorldClass1
{        
    /// <summary>
    /// Runs the class with the specified arguments.
    /// </summary>
    /// <param name = "_args">The specified arguments.</param>
    public static void main(Args _args)
    {        

        info("Hello World"); 

    }

}

Save the file and from the toolbar click on Build -> Build Solution.

After the solution finished to build, you will need to set your class as a Startup Object in order to run. Right click on you class and select Set as Startup Object

From the toolbar click on Debug -> Start without Debugging

And that's it.