Home computer programming, dynamics ax, others, windows 10, windows server ax2012-how to recalculate inventsum
computer programmingdynamics axotherswindows 10windows server

ax2012-how to recalculate inventsum

while the ax programmer using x++ to creating customization that connect to inventtrans, sometimes they have a forget code that invent trans effect to inventsum
or sometimes when the proses working, aos hang etc

so the solution is we must recalculate the inventsum so the sum of inventtrans = inventsum

this is my source code to calculate invent sum

(remember, doing this at non working hours, especially all items)

 

static void RON_RecalcinventSum(Args _args)
{
    
    //membersihkan ulang inventsum di kalkulasi ulang dari inventtrans agar nilainya kurang lebih sama
    InventTable InventTable;
    InventSumRecalcItem InventSumRecalcItem;
    ;

    WHILE SELECT InventTable
    WHERE (InventTable.ItemType == ItemType::Item)
    {    
         InventSumRecalcItem = new InventSumRecalcItem(InventTable.ItemId, true, checkfix::fix);
         InventSumRecalcItem.updatenow();
    } 
    
    /*
    InventSumRecalcItem InventSumRecalcItem;
    ; 
    
    InventSumRecalcItem = new InventSumRecalcItem("QL10145GN", true, checkfix::fix);
    InventSumRecalcItem.updatenow();
    */
}

 

 

Author

Ronny

Leave a Reply