Dec 3, 2013

Writing values to CSV in AX

static void testWriteToCSV(Args _args)
{
#File
CommaTextIo commaTextIo;
FileIOPermission permission;
SalesTable sales;
str fileName = @"C:\MyFileName.csv";
;
permission = new FileIOPermission(fileName,#io_write);
permission.assert();
commaTextIo = new CommaTextIo(fileName,#io_write);
while select sales
{
commaTextIo.writeExp([Sales.SalesId,Sales.CustAccount]);
}
CodeAccessPermission::revertAssert();

}


No comments: