On recent enhancement there was a scenario that for some condition I need to reset the production order status from Estimated/Scheduled to created and need to delete the production order. The reference to this production order also should be removed from sales order.
I wrote the following code
ProdTable = prodtable::find(_prodId, true);
prodTable.prodStatus = ProdStatus::created;
checkFailed(strFmt(@”Delete of Production order %1 is failed.”, _prodId));
after resetting this I deleted the production order using delete_from and it deletes the coproduct records too.
I thought it worked fine. But actually it deletes the Production line reference from inventory transaction and not co-product reference from inventory transaction. Filter the production order that was reset recently in IM > Inquiries > Transaction. you can see the co-product reference is not deleted.
So I debugged more and I found the right code…
View original post 102 more words