AX – D365FO – Append text in an existing file with TextIO Class

TextIo              textIo;
str                 sTempPath, sFileName;

sTempPath   = WINAPI::getTempPath();
sFileName   = dateTodayStr + "_CloseInactiveOrders.txt";

textIo      = new TextIo(sTempPath + sFileName, "A"); //Type "A" to append the text to an existing file

lineStr = 'Hello world';

textIo.write(lineStr);

These are the mode in which the file should be opened. Specify one the following:
R – Read
W – Write
A – Append (implies “W”)
T – Translate (text)
B – Binary

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s