If you were forced to make manual updates to the InventTrans table, your on-hand inventory counts may look off. Fortunately, there’s a built-in class to recalculate the InventSum table:
InventSumRecalcItem = new InventSumRecalcItem(“ItemID”, TRUE, checkfix::fix);
Replace “ItemID” with the ItemID of the item you wish to correct.
The second parameter (TRUE or FALSE) indicates whether to show errors.
The third parameter indicates whether to recalculate (checkfix::fix), or just check for discrepancies (checkfix::check).
You can also run this on the entire InventSum table:
WHILE SELECT InventTable
WHERE (InventTable.ItemType == ItemType::Item) || (InventTable.ItemType == ItemType::BOM)
InventSumRecalcItem = new InventSumRecalcItem(InventTable.ItemId, TRUE, checkfix::fix);