x++

Getting started with x++

Remarks#

X++ is an object-oriented language with similarities to C#. X++ is part of the MorphX development platform that you use to construct accounting and business management systems.

MSDN: X++ Programming Guide

Versions#

VersionAdditional InformationRelease date
7Dynamics 365 for Finance and Operations, Enterprise Edition2016-03-01
6Dynamics AX 20122011-08-01
5Dynamics AX 20092008-06-02
4Dynamics AX 4.02006-06-09
3Dynamics AX 3.02002-10-01
2Dynamics AX 2.52000-12-01

Installation or Setup

Detailed instructions on getting x++ set up or installed.

Hello World

This example will walk the user through creating a job where they can run X++ code within Dynamics AX.

There is a node titled Jobs in the Application Object Tree (AOT). This sample can be added under the Jobs node, and then the job can be run.

  1. Within Dynamics Ax, open the AOT (Application Object Tree).

  2. Navigate to Jobs and right click the node.

  3. Click New Job which will cause Ax to open a code editor window.

  4. Enter the following text inside the code editor. You can run the code by pressing F5.

    static void Job1(Args _args) // Job1 will be the name of the job in the AOT {

     ;  // This semicolon is necessary to mark the end of variable declarations in versions AX 2009 and lower.  If you are interested in the details see https://stackoverflow.com/questions/1976080/is-semicolon-really-needed-after-declarations-in-x
     
     info('Hello world.');   // Shows the text "Hello world" in a dialog called "infolog"

    }


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow