Hi Guys,
I have registered PO lines using Item arrival journal.
Need to unregister more that 500 lines. below are lines of code to unregister item: -
static void testUnregistration(Args _args)
{
PurchTable purchTable;
InventTrans inventTrans;
InventTransOrigin inventTransOrigin;
PurchLine purchLine;
InventDim inventDim;
TmpInventTransWMS tmpInventTransWMS;
InventTransWMS_register inventTransWMS_register = inventTransWMS_register::newStandard(tmpInventTransWMS);
while select purchLine where purchLine.PurchId == this.PurchId
{
select inventTransOrigin
where inventTransOrigin.ReferenceId == purchLine.PurchId
&& inventTransOrigin.ItemId == purchLine.ItemId;
while select inventTrans
where inventTrans.InventTransOrigin == inventTransOrigin.RecId
{
select inventDim where inventDim.inventDimId == inventTrans.inventDimId;
if (inventTrans.StatusReceipt == StatusReceipt::Registered)
{
inventTransWMS_register.createFromInventTrans(inventTrans, inventDim);
inventTransWMS_register.updateInvent(purchLine);
}
}
}
}