Delete a reservation on an item

There is the code for delete a reservation:

    while (queryRun.next())
    {
        inventTable = queryRun.get(tablenum(InventTable));

        while select inventTrans
            where   inventTrans.ItemId          == inventTable.ItemId
            &&     (inventTrans.StatusIssue     == StatusIssue::ReservPhysical
            ||      inventTrans.StatusIssue     == StatusIssue::ReservOrdered)
        {
            i++;
            InventTrans::DeleteMarking(inventTrans.InventTransId, inventTrans.InventRefTransId, inventTrans.Qty, false, null, null, #ShowDetails);
        }
    }
Advertisements