Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Monday, August 20, 2018

Unable to Enable Warehouse Management II License Key

In AX 2012 R3 CU12, after disabling Trade > Warehouse and Transportation Management the Warehouse Management II license cannot be enabled in License information.

“You can not add this license code because the following required license codes have not been entered: Warehouse management I”


The fix was:
1. Kick out other users
2. Keep AOS online and AX open
3. Backup business data SQL database
4. Run this SQL on business database: DELETE SysConfig WHERE ConfigType IN (0, 1, 2)
5. Open License information in AX
6. Apply Microsoft AX license key, no DB sync
7. Apply any partner licenses, no DB sync
8. Check that Warehouse Management II is check-marked in the license information
8. DB sync
9. Axbuild.exe
10. Full CIL

Monday, February 5, 2018

AX 2012 Database Synchronization Warnings and Errors


After making a change to the data dictionary AX will synchronize to the SQL database.  If you have turned off configuration keys the window which pops up shows many warnings, most of which can be ignored every time.  How do you know which of the warnings should be reviewed?

Open SQL Server and run the following command.  It lists the warnings and errors in one consolidated grid and it ignores any configuration key warnings which can be disregarded.

select TableName,
       [Text],
       ID,
       ParentID,
       case MessageType
              when 0 then 'Header'
              when 1 then 'Warning'
              when 2 then 'Error'
              else Convert(nvarchar(5), MessageType)
       end as MessageType,
       SyncTable,
       WarningOK,
       [Sequence]
from SqlSyncInfo
where MessageType <> 0 -- remove headers
       and [Text] not like '%disabled%' -- disabled configuration keys can be ignored
order by MessageType, [Sequence]

Friday, June 2, 2017

Export AX Ledger Transactions via SQL

This SQL serves as a starting point to include any number of financial dimensions.

SELECT GENERALJOURNALENTRY.SUBLEDGERVOUCHER as Voucher,
DIMENSIONATTRIBUTEVALUECOMBINATION.DisplayValue as [Account+Dims],
MAINACCOUNT.MainAccountID as [Account],
DIMENSIONATTRIBUTELEVELVALUE.DisplayValue as [Dept],
GENERALJOURNALACCOUNTENTRY.ACCOUNTINGCURRENCYAMOUNT as AmountMST,
GENERALJOURNALACCOUNTENTRY.TRANSACTIONCURRENCYAMOUNT as AmountCur,
GENERALJOURNALACCOUNTENTRY.TRANSACTIONCURRENCYCODE as CurrencyCode
FROM DynamicsAX2012.GENERALJOURNALENTRY
INNER JOIN DynamicsAX2012.GENERALJOURNALACCOUNTENTRY
ON GENERALJOURNALENTRY.RECID = GENERALJOURNALACCOUNTENTRY.GENERALJOURNALENTRY
INNER JOIN DynamicsAX2012.DIMENSIONATTRIBUTEVALUECOMBINATION
ON DIMENSIONATTRIBUTEVALUECOMBINATION.RECID = GENERALJOURNALACCOUNTENTRY.LEDGERDIMENSION
INNER JOIN DynamicsAX2012.DIMENSIONATTRIBUTEVALUEGROUPCOMBINATION
ON DIMENSIONATTRIBUTEVALUEGROUPCOMBINATION.DIMENSIONATTRIBUTEVALUECOMBINATION = DIMENSIONATTRIBUTEVALUECOMBINATION.RECID
INNER JOIN DynamicsAX2012.DIMENSIONATTRIBUTELEVELVALUE
ON DIMENSIONATTRIBUTELEVELVALUE.DIMENSIONATTRIBUTEVALUEGROUP = DIMENSIONATTRIBUTEVALUEGROUPCOMBINATION.DIMENSIONATTRIBUTEVALUEGROUP
and DIMENSIONATTRIBUTELEVELVALUE.DimensionAttributeValue = 5637146881 -- s/b a lookup to DimensionAttribute
INNER JOIN DynamicsAX2012.MAINACCOUNT
ON MAINACCOUNT.RECID = DIMENSIONATTRIBUTEVALUECOMBINATION.MAINACCOUNT
WHERE MAINACCOUNT.MainAccountID LIKE '6%'
 AND DIMENSIONATTRIBUTELEVELVALUE.DISPLAYVALUE = '600'