Generate Text File through the selected records in ax 2012
void clicked()
{
LedgerJournalTrans ledgerJournalTrans1;
BinData binData;
TextBuffer textBuffer;
CustTable custtable;
;
textBuffer = new TextBuffer();
textBuffer.setText('');
ledgerJournalTrans1 = LedgerJournalTrans_ds.getFirst(1);
while(ledgerJournalTrans1)
{
textBuffer.appendText(strfmt(' %1 %2 %3 %4 %5 %6 \r\n',DimensionAttributeValueCombination::find(LedgerJournalTrans.LedgerDimension).DisplayValue,
ledgerJournalTrans1.Txt,
ledgerJournalTrans1.AmountCurDebit,
ledgerJournalTrans1.AmountCurCredit,
ledgerJournalTrans1.OffsetAccountType,
DimensionAttributeValueCombination::find(LedgerJournalTrans.OffsetLedgerDimension).DisplayValue));
ledgerJournalTrans1 = LedgerJournalTrans_ds.getNext();
}
textBuffer.getText();
binData = new BinData();
binData.setStrData(textBuffer.getText());
binData.saveFile(@"d:\CustomerPaymentDetails.txt");
info("Text File has been generated in 'D' Drive with CustomerPaymentDetails name");
}
{
LedgerJournalTrans ledgerJournalTrans1;
BinData binData;
TextBuffer textBuffer;
CustTable custtable;
;
textBuffer = new TextBuffer();
textBuffer.setText('');
ledgerJournalTrans1 = LedgerJournalTrans_ds.getFirst(1);
while(ledgerJournalTrans1)
{
textBuffer.appendText(strfmt(' %1 %2 %3 %4 %5 %6 \r\n',DimensionAttributeValueCombination::find(LedgerJournalTrans.LedgerDimension).DisplayValue,
ledgerJournalTrans1.Txt,
ledgerJournalTrans1.AmountCurDebit,
ledgerJournalTrans1.AmountCurCredit,
ledgerJournalTrans1.OffsetAccountType,
DimensionAttributeValueCombination::find(LedgerJournalTrans.OffsetLedgerDimension).DisplayValue));
ledgerJournalTrans1 = LedgerJournalTrans_ds.getNext();
}
textBuffer.getText();
binData = new BinData();
binData.setStrData(textBuffer.getText());
binData.saveFile(@"d:\CustomerPaymentDetails.txt");
info("Text File has been generated in 'D' Drive with CustomerPaymentDetails name");
}
No comments:
Post a Comment