Wednesday 5 November 2014

Rebuild indexes

And another small post for the archive. If you'd like to rebuild an index (due to fragmentation or growth), you can use the following statement: 


USE [namedatabase]


ALTER INDEX ALL ON [dbo].[nametable] REBUILD;

Deploy reports AX 2012

Another small post for my own archive. To deploy a report, you can use the following command in powershell

Publish-axreport -servicesaosname 01@nameAOS -servicesaoswsdlport 8101 -reportname PurchPurchaseOrder

Tuesday 4 November 2014

Inventsum recalculation

Due to different kinds of problems, it can be needed to recalculate the inventsum for an item. The cause is most of the time incorrect manipulation of the inventtrans records (due to manual adjustments or for example incorrect software modifications). 

There's the possibility to run the consistency check which will recalculate the onhand stock for all items. This is an operation which can take a serious amount of time. If you'd only want to recalculate for one item: 

InventSumRecalcItem InventSumRecalcItem;

InventSumRecalcItem = new InventSumRecalcItem("itemnumber", true, checkfix::fix);
InventSumRecalcItem.updatenow();