How to write in a CSV file from X++
Use this code 🙂
static void Classes_CommaIo(Args _args)
{
CommaIo fileOut;
FileName fileName = “c:Customers.csv”;
CustTable custTable;
;
#File
fileOut = new CommaIo(filename, #io_write);
if (fileOut)
{
while select custTable
{
fileOut.write(custTable.accountNum,
custTable.name,
custTable.custGroup,
custTable.currency);
}
}
}
Happy Daxing!