Posts

Showing posts from March, 2010

How to get the current active company in AX

By running the curExt() function the current active company is returned. static void curExtExample(Args _arg) { str s; ; // Sets s to the extension of the current company. s = curExt(); print "Current extension is " + s; pause; }

Removing duplicate records

When you make a change in the layers of AX you will be faced with the installtion checklist. I some cases a removal of a layer might cause duplicates of records that can cause error when trying to synchronize the tables. To solve this problem a removal of the duplicate records is necessary. This can be done with the sql query below: delete from LedgerBalancesDimTrans where exists( select * from LedgerBalancesDimTrans as test_inner where test_inner.dataareaid = LedgerBalancesDimTrans.dataareaid and test_inner.accountnum = LedgerBalancesDimTrans.accountnum and test_inner.transdate =LedgerBalancesDimTrans.transdate and test_inner.periodcode = LedgerBalancesDimTrans.periodcode and test_inner.dimension = LedgerBalancesDimTrans.dimension and test_inner.dimension2_ = LedgerBalancesDimTrans.dimension2_ and test_inner.dimension3_ = LedgerBalancesDimTrans.dimension3_ and test_inner.ledgerbalancesvariant = LedgerBalancesDimTrans.ledgerbalancesvar