Using X++ code cancel all the remain delivery quantity with the sales order
static void Jimmy_CancelRemainQtyFromSO(Args _args) { SalesLine UpRemainSalesLine; SalesTable SalesTable; SalesId SalesId = "QVSC002819HK"; ; ttsbegin; if (Box::yesNo(strfmt("是否取消订单 %1 的所有剩余交货?",SalesId) +"\n",DialogButton::No)==DialogButton::Yes) { SalesTable = SalesTable::find(SalesId); while select forupdate UpRemainSalesLine where UpRemainSalesLine.SalesId == SalesId { if (salesTable.checkUpdate()) { UpRemainSalesLine.RemainSalesPhysical = 0; UpRemainSalesLine.RemainInventPhysical = 0; InterCompanyUpdateRemPhys::synchronize(UpRemainSalesLine, UpRemainSalesLine.RemainSalesPhysical, UpRemainSalesLine.RemainInventPhysical); UpRemainSalesLine.update(); //SalesLine_ds.reread(); //SalesLine_ds.refresh(); } } } ttscommit; }