Home computer programming, dynamics ax, others [ax 2012] inventsum recalculation
computer programmingdynamics axothers

[ax 2012] inventsum recalculation

in ax, during your customization, sometimes you have do the custom wrong

for example, in ax, in inventory system,

  1. sometimes we do creating a inventtrans transaction that might be forget to using Update() syntax (and we using DoUpdate() syntax)
  2. we forget to deactivate allow negative stock, and we force it to active allow negative stock by query

that will cause the total from inventtrans table is not same as inventsum table

this is how to solve it

we created a jobs, a job that will calculate the item (all the item)

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

Author

Ronny

Leave a Reply