Monday, April 4, 2011

A hidden feature of the output window

If you are an Ax developer then you've probably used the Print command in Dynamics Ax, either to do some debugging or during testing of code.  The print command allows you to print some results or some values to screen.  Optionally enter a pause statement at the end, in order to be able to read the actual output.

Example:

static void WindowDemo(Args _args)
{
    print('Hello world');
    pause;
}

Sort of a hidden feature in Ax, is that you can actually control the output window, both size and position.  You can use the Window command for that.

Example:

static void WindowDemo(Args _args)
{
    window 120,60 at 5,5;
    print('Hello world');
    pause;
}
With the Window command in following format

   window deltax, deltay at x,y

x   Top left position of the window, x-coördinate (Horizontal)
y   Top left position of the window, y-coördinate (Vertical)
deltax   Width of the window, in characters
deltay   Height of the window, in lines of text

1 comment:

  1. Sorry for the off-topic comment but i don't find your mail,
    hi,
    i need read to external database but after i need to isnert data into table in dynamics ax,it's possible to use insert_recordset whit resultset, i have external table whit milion record and while(resultset.netxt()) is not perfomance, do you have any solution?
    thanks

    ReplyDelete