How to use a recurring Integration Endpoint for importing data
You are here
AX 2012 Enum Dictionary For Reporting
AX 2012 Enum Dictionary For Reporting
I have run into several instances where I would like an easy way in SQL to convert an enum into its label equivalent. Converting some stuff by hand just to get meaningful data can be tedious; LedgerTransType is a good example. So, I created this simple solution. The attached project allows you to dump out to a table, called AAX_EnumDictionary, all of your enums so you can join then in on a report to get the labels. This is language independent and can be configured to write out only the enum labels for the system language, or all languages. Depending on how many languages you have license keys loaded, the table can become huge. There are about 24k records per language and if you have 100 languages available by licenses, you can see the problem that is created.
This comes with two config options.
 
- Only Scan For Changes: Will only pickup changes, like if a new value was added to an enum and you want to pick it up. I recommend checking this.
- Include All Languages: Includes all languages licensed for your instance. Use as you see fit. I suggest reviewing your active languages before using this option.
Also, this is batchable so set it to pickup changes every Saturday night and call it good. You can at any time wipe and rebuild the table by running it as the image above shows. Once you have this loaded and data available for consumption, you can do this:
select distinct top 10 ljt.TRANSACTIONTYPE, ed.LABELfrom LedgerJournalTrans ljtleft join AAX_EnumDictionary ed on ed.ENUM = 'LedgerTransType'and ed.ENUMVALUE = ljt.TRANSACTIONTYPEand ed.LANGUAGEID = 'en-us'
and you will see this (using Contoso data)
This opens the door for some meaningful to users reporting by being able to include enum labels for anything. Here is another example:
select top 10 ljt.JOURNALNUM,ljt.LINENUM,ed.LABEL,ljt.AMOUNTCURCREDIT,ljt.AMOUNTCURDEBIT,ljt.COMPANYfrom LedgerJournalTrans ljtleft join AAX_EnumDictionary ed on ed.ENUM = 'LedgerTransType'and ed.ENUMVALUE = ljt.TRANSACTIONTYPEand ed.LANGUAGEID = 'en-us'