JOB X++ MICROSOFT AX DATA IN CSV FILES WINAPI
static void VIK_VM_SalesLineToCSVTable(Args
_args)
{
PurchLine purchLine;
SalesLine salesline;
Query q;
QueryBuildDataSource qbds;
QueryBuildRange qbr;
QueryRun qr;
CommaIO commaIO;
FileName fileName;
InventTable inventTable;
salestable
salestable;
;
fileName = "C:\\Vicky\\" +
"SAlesline_serial_newD" + ".txt"; //Destination of the file
commaIO = new CommaIO(fileName,'W');
commaIO.write("Sales Id",
"Custaccount","Itemid","SalesStatus",
"Serial Number"); //Header of the CSV File
//Loop to insert values in the csv from the
table
while select salesline
join salestable where
SalesLine.salesid == SalesTable.salesid && salestable.salesstatus ==
SalesStatus::Backorder
// && salesline.SalesId like
"%SOD%"//(salestable.salesstatus == SalesStatus::Delivered ||
salestable.salesstatus == SalesStatus::Backorder)//&&
salestable.SalesId like "%SOD%"
{
commaIO.write(salesline.SalesId, salestable.CustAccount,
SalesLine.ItemId,SalesTable.SalesStatus,SalesLine.inventDim().inventSerialId);
}
WINAPI::shellExecute(fileName);
info("DONE.");
}
No comments:
Post a Comment