Monday, November 23, 2020

Reserve and Unreserve Sales order line X++ D365FO

Code for reserve and unreserved  sales order lines

Inputs: SalesLine, InventDim (Combination to reserve), Qty

Note

To Reserve -> Pass Qty as negative

To Unreserved -> Pass Qty as positive

Code:

InventMovement         movement;

movement = inventTrans::findTransId(_salesLine.InventTransId).inventMovement(true); 

InventUpd_Reservation   reservation;

 reservation  = InventUpd_Reservation::newInventDim(movement, _inventDim, _qty, false);

reservation.updateNow();

No comments:

Post a Comment

Search hierarchy for a match (TableALLGroup) X++

  Table1 ppt;  select firstonly ppt  order ItemCode, ItemRelation, AccountCode, AccountRelation where      (ppt.ItemCode == TableGroupAll::T...