AX2012 利用InventSumRecalcItem 类修复 inventTrans 与InventSum 数据不匹配

static void RFCalculateInventSum(Args _args)
{
    InventSumRecalcItem InventSumRecalcItem;
    InventTable         it;
    ;
    while select it
    {
        InventSumRecalcItem = new InventSumRecalcItem(it.ItemId, true, checkfix::fix);
        InventSumRecalcItem.updatenow();
    }
    info("done");
}

when the calculate progressed, it will shows you the info and errors:

  • info
    • shows you when they fixed the stock, the invent sum, the cost
  • errors
    • shows you an error, sometimes they told you that the current item has a negative physical, and because of that, they cannot recalculate the inventsum

if the errors occurs, fixed the inventory by using counting journal or inventory journal movement,

after you have no negative stock, just execute jobs again

原文地址:https://www.cnblogs.com/sxypeace/p/14183514.html