06 February 2014

Write data to text file in AX 2012 and AX 2009

static void writeDataToTxt(Args _args)
{

CustTable custTable;
BinData binData;
TextBuffer textBuffer;
;

textBuffer = new TextBuffer();
textBuffer.setText('');

while select custTable
{
textBuffer.appendText(strfmt('%1\r\n',custTable.AccountNum));
}

textBuffer.getText();

binData = new BinData();
binData.setStrData(textBuffer.getText());
binData.saveFile(@"C:\fileOUt\test.txt");

}

No comments:

Post a Comment

Give me the commetns and solutions

How to add the Display method in the form level in D365 F&O

 The below examle is to add the form -Data source level adding display method and assigning to form design control.