SalesUpdateRemain::construct().updateDeliverRemainder(salesLine, salesQty, inventQty, cwQty);
InventQty diffRemainSalesPhysical = _salesLine.RemainSalesPhysical - _remainSalesPhysical; InventQty diffRemainInventPhysical = _salesLine.RemainInventPhysical - _remainInventPhysical; PdsCWInventQty diffPdsCWRemainInventPhysical = _salesLine.orig().PdsCWRemainInventPhysical - _cWRemainInventPhysical; _salesLine.RemainSalesPhysical = _remainSalesPhysical; _salesLine.RemainInventPhysical = _remainInventPhysical; if (_salesLine.RemainInventPhysical) {
if (PdsGlobal::pdsIsCWItem(salesLine.ItemId)) { salesLine.PdsCWRemainInventPhysical = cwQty; } SalesUpdateRemain::construct().updateDeliverRemainder(salesLine, salesQty, inventQty, cwQty);
/// <summary> /// An extension class of the <c>SalesUpdateRemain</c> class. /// </summary> [ExtensionOf(classStr(SalesUpdateRemain))] public final class NXRSalesUpdateRemainCls_Extension { /// <summary> /// CoC for updateDeliverRemainder() method /// </summary> /// <param name="_salesLine"> /// The instance of <c>SalesLine</c> for which delivery remainder is set. /// </param> /// <param name="_remainSalesPhysical"> /// New value for remaining physical sales quantity. /// </param> /// <param name="_remainInventPhysical"> /// New value for remaining physical inventory quantity. /// </param> /// <param name="_cWRemainInventPhysical"> /// New value for remaining physical inventory CW quantity. /// </param> /// <returns> /// true if the line's delivery remainder was successfully updated; otherwise, false. /// </returns> public boolean updateDeliverRemainder( SalesLine _salesLine, InventQty _remainSalesPhysical, InventQty _remainInventPhysical, PdsCWInventQty _cWRemainInventPhysical) { if (PdsGlobal::pdsIsCWItem(_salesLine.ItemId)) { // even though we pass _cWRemainInventPhysical to updateDeliverRemainder() - it does not set it on the SalesLine buffer and therefore fails // setting PdsCWRemainInventPhysical before updateDeliverRemainder() to work in same way as when updating deliver remainder from UI _salesLine.PdsCWRemainInventPhysical = _cWRemainInventPhysical; } return next updateDeliverRemainder(_salesLine, _remainSalesPhysical, _remainInventPhysical, _cWRemainInventPhysical); } }
If you found value in what I share, I've set up a Buy Me a Coffee page as a way to show your support.
Buy Me a CoffeeNo comments. Be the first one to comment on this post.
DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics 365 FO.
Authors are allowed to set their own "buy me a coffee" link.
Join us.