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

Invent closing slow

The following added indexes did the trick for us:

InvenSettlement

  • SettleTransIdx (set as ClusterIndex on table properties)
    1. SettleTransId
    2. Cancelled
    3. SettleType
    4. QtySettled

InventTrans

  • InventRefTransIdx
    1. ItemId
    2. ValueOpen
    3. InventRefTransId
  • StatusIssueIdx
    1. ItemId
    2. ValueOpen
    3. StatusIssue