CommaIo file;
container line;
LedgerTable ledgerTable;
#define.filename('\\accounts.csv')
#File
;
file = new CommaIo(#filename, #io_write);
if (!file || file.status() != IO_Status::Ok)
{
throw error("File cannot be opened.");
}
while select ledgerTable
{
line = [
ledgerTable.AccountNum,
ledgerTable.AccountName];
file.writeExp(line);
}
To Cancel Deliver Remainder through X++ you can use below code sample. Thanks. static void _CancelDeliverRemainder_Sales(Args _args) { SalesLine SalesLine = SalesLine::find('SO0013', true); ; if (SalesLine) { // Set remaining inventory Qty to zero SalesLine.RemainInventPhysical = 0; // Set remaining physical Qty to zero SalesLine.RemainSalesPhysical = 0; // We have to cancel the SalesLine SalesLine.PurchStatus = PurchStatus::Canceled; SalesLine.update(); ...