Use of TextIO

There is a little simple example of “How to use the TextIO” classes.


public void writeOnFile(FileName _fileName, str _value)
boolean first = true;
container value;
TextIO file;

//add to the end of the file
//file = new AsciiIO(_fileName, #io_append);
//create a new file
file = new AsciiIO(_fileName, #io_write);
value += _value;


private void importFile(FileName _fileName)
TextIO file = new TextIO(_fileName, #io_read);
if (!file || file.status() != IO_Status::Ok)
throw error("Can't open file"); }
line =;
while (conLen(line))
// Your code
line =;
file = null;

AX 2012 – Editor wizard statement

Just a little tips over the editor with the try/catch statement.
Begin to write “try”
Press “tabulation” and you will receive the result below
You cursor will be put in the try statement.
I just try it with the “if”, “else” and “switch” statement, that’s work also.

AX 2012 – Editor wizard for "parm" method

You maybe know already it, but I discover it today.
When you create a new method, you delete all caracter in the method, and juste write “parm” and after press “Tabulation”.
You will have a popup for create a parm method.
This wizard is limited to EDT parm method :-(

You can’t create a parm method who return a table, you must use the old method :-) : from scratch.

Shell execute on batch server

There below the code for simulate a ShellExecute method for the Batch, because, as you have certainly see, we can’t execute the standard WinAPI::execute() method.
I make my example with the FTP command.
server static void shellExecuteFTP(Filename _fileName, str _localFolder)

System.Diagnostics.Process process;
System.Diagnostics.ProcessStartInfo processStartInfo;

new InteropPermission(InteropKind::ClrInterop).assert();

process = new System.Diagnostics.Process();

processStartInfo = new System.Diagnostics.ProcessStartInfo();




Posted in AX5

Object Server 02: Concurrent number of AOS’ for this application exceeds the licensed number.

I receive this error. There below the solution to launch your AOS.
I have next situation: I create a copy of my production database and restore it to my test database. Then I try to start my second test AOS (stopped to allow restore of db):
Object Server 02: Concurrent number of AOS' for this 
application exceeds the licensed number.
  • Stop your production AOS
  • Start test AOS
  • Start production AOS again.

Included columns in Dynamics AX 2012

You will find the link who explain the process :
Little part of the post:
Included columns is a feature of SQL Server (since version 2005) related to indices.Thanks to it you can attach additional fields to an index that are not used for searching (so they don’t have to be maintained so expensively) but that can be used by database server to return data. If all columns being returned by a query are included in an index, database server can directly return data and it doesn’t have to touch the table itself (and that saves time, of course).
Included columns also have additional advantages:
  • can be added to a unique index without influencing uniqueness
  • support even (some) types that can’t be used in normal indices
  • don’t count to the limit of number of index columns (16)
  • don’t count to the limit of index size (900 bytes)
The following (logical) restriction apply:
  • are always at the end of index
  • the index must contain at least one “normal” (key) column
  • can’t be used in clustered indices
Of course, even included columns have impact to index size so they can slow down operations with the index and consume disk space.