web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

CommaTextIO occasionally writing empty file

(0) ShareShare
ReportReport
Posted on by 135

Hello,

There is a process for our business that writes out order information to a csv file that is then FTP'd to a shipping company.  However, this process sometimes writes out an empty csv file when there should have been data.  I cannot figure out the problem with the code and was wondering if perhaps I was doing something obviously wrong?  _conRecords is a container of containers, where the containers hold the information such as item number, price, etc. 

fullFileName = HAExportFileHelper::createFileName(_filePath, _fileName, _extention);
fileIOPermission = new FileIOPermission(fullFileName, #io_write);
fileIOPermission.assert();
commaIoWrite = new CommaTextIo(fullFileName, #io_write, #ANSIEncoding);

commaIoWrite.outFieldDelimiter(_fieldDelimiter);
commaIoWrite.outRecordDelimiter(#delimiterCRLF);

conLength = conLen(_conRecords);

for (conIdx = 1; conIdx <= conLength; conIdx++)
{
commaIoWrite.write(conPeek(_conRecords, conIdx));
}

commaIoWrite = null;
CodeAccessPermission::revertAssert();
info(strFmt("Data has been exported to file %1.", fullFileName));

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    304,121 Super User 2026 Season 1 on at

    Hi AXGreenHorn,

    Are you using the same filename or are there some variables like date/time which is added to the filename? Have you reviewed the coding which compiles the container _conRecords? Have you also tried to use the debugger to find out more on this?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans