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