Ok so I have this api, in the request body i send an updated qty for the lines of a Transfer Journal. the quantity gets updated successfully, but when i go look into the inventory transactions for that item and search it with that journal id, the quantity remains same as before.
But when i do this process directly from dynamics. If i update the quantity of the line, lets say it was -5 before, i change it to -7 and save it on the form, then if i refresh the inventory transactions, the quantity of it also changes accordingly.
I have attached relevant screenshots and the code, Kindly help.
if (_InventJournalTrans.UnitQty != _currLine.parmQty() * -1)
{
//ttsbegin;
////inventJournalTrans.modifyInventJournalTransUnitQty(inventJournalTrans.Unit);
//_InventJournalTrans.selectForUpdate(true);
////_InventJournalTrans.Qty = _currLine.parmQty() * -1;
////_InventJournalTrans.UnitQty = _currLine.parmQty() * -1;s
//_InventJournalTrans.Qty = _currLine.parmQty() * -1;
//_InventJournalTrans.editUnitQty(true, _currLine.parmQty() * -1);
//_InventJournalTrans.Notes = _currLine.parmNote();
//_InventJournalTrans.modifyInventJournalTransQty();
//_InventJournalTrans.update(NoYes::Yes);
//ttscommit;
ttsbegin;
_InventJournalTrans.selectForUpdate(true);
_InventJournalTrans.Notes = _currLine.parmNote();
_InventJournalTrans.editUnitQty(true, _currLine.parmQty() * -1);
_InventJournalTrans.modifyInventJournalTransQty();
_InventJournalTrans.doUpdate();
ttscommit;
}
