Cancel salesline through code in D365 FO X++
static void cancelSalesLine(Args _args)
{ boolean updated; SalesLine salesLine; try { ttsBegin; salesLine = SalesLine::findInventTransId('012411', true); updated = SalesUpdateRemain::updateDeliveryRemainder(salesLine, 0, 0); if(updated) { info("Salesline canceled"); } ttsCommit; } catch { error("SalesLine could not be canceled"); } }
Comments
Post a Comment