Friday, 15 January 2016

Unreserved "Physical Reserved" Qty in Ax 2009 thru x++

To remove a reservation (just reverse the sign on the qty):
In the code below, ‘inventTransParent’ is the inventTransId of the record that has the reservation (e.g. salesline.inventTransId)
You probably will want to modify the ‘where’ clause a bit to make sure you get the reservation records only, but this is just an example.
//Remove any existing reservations
InventTrans            inventTransReserve    ;
InventMovement         inventMovement        ;
InventUpd_Reservation  inventUpd_Reservation ;
while select inventTransReserve where inventTransReserve.InventTransId == inventTransParent
   Inventmovement = inventTransReserve.inventmovement(true);
   inventUpd_Reservation = InventUpd_Reservation::newInventDim(inventmovement,inventTransReserve.inventDim(), -1 * inventTransReserve.Qty ,false);    inventUpd_Reservation.updatenow();

No comments:

Post a Comment