// Write Data to Text file from AX
static void WriteTextfile(Args _args)
{
CustTable custTable;
BinData binData;
TextBuffer textBuffer;
boolean header;
;
header = true;
textBuffer = new TextBuffer();
textBuffer.setText('');
while select custTable
{
header = true;
if (header)
{
textBuffer.appendText(strfmt("%1 - %2 \r\n",custTable.AccountNum,CustTable::find(custTable.AccountNum).name()));
header = false;
}
textBuffer.appendText(strfmt('\t"%1","%2","%3","%4","%5","%6","%7","%8"\r\n',
custTable.AccountNum,custTable.AccountStatement,custTable.Currency,custTable.CashDisc,
custTable.DlvTerm,custTable.InvoiceAccount,custTable.CustGroup,custTable.DlvMode));
}
textBuffer.getText();
binData = new BinData();
binData.setStrData(textBuffer.getText());
binData.saveFile(@"d:\ValidationFileGenerationTest.txt");
}
static void WriteTextfile(Args _args)
{
CustTable custTable;
BinData binData;
TextBuffer textBuffer;
boolean header;
;
header = true;
textBuffer = new TextBuffer();
textBuffer.setText('');
while select custTable
{
header = true;
if (header)
{
textBuffer.appendText(strfmt("%1 - %2 \r\n",custTable.AccountNum,CustTable::find(custTable.AccountNum).name()));
header = false;
}
textBuffer.appendText(strfmt('\t"%1","%2","%3","%4","%5","%6","%7","%8"\r\n',
custTable.AccountNum,custTable.AccountStatement,custTable.Currency,custTable.CashDisc,
custTable.DlvTerm,custTable.InvoiceAccount,custTable.CustGroup,custTable.DlvMode));
}
textBuffer.getText();
binData = new BinData();
binData.setStrData(textBuffer.getText());
binData.saveFile(@"d:\ValidationFileGenerationTest.txt");
}
No comments:
Post a Comment