I have written following code on button click on Packing Slip journal form to reverse packing slip.
_purchLine.PurchReceivedNow = _vendPackingSlipTrans.Qty * -1;
_purchLine.setInventReceivedNow();
_purchLine.update();
purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);
purchFormLetter.update(
_purchTable, // Purchase record buffer
VendPackingSlipJour.InternalPackingSlipId, // Invoice Number
VendPackingSlipJour.DeliveryDate, // Transaction Date
PurchUpdate::ReceiveNow, // Quantity update
AccountOrder::None,
NoYes::No,
NoYes::Yes);
The code is setting negative quantity in Receive Now field and then posting packing slip and running fine except one thing that it is cancelling the line whereas it should make the quantity being updated as open.
I will be grateful if anyone of you could let me know what is wrong with this code which is cancelling the quantity.
Rgds
Haroon