web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Get enum label values outside ax from sql.

(0) ShareShare
ReportReport
Posted on by

Hello,

I want to get enum value from sql server (that works also for system enum and user enum, of course), by sending its integer value.

How can I do that?

Thanks :)

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Create a batch process which dumps all your enums with their values to a custom table will do the job.

  • Community Member Profile Picture
    on at

    I found a blog on: abraaxapta.blogspot.co.uk/.../accessing-enum-labels-from-outside-ax.html

    I am looking for that solution, but better (without any bugs as following - or what may be wrong, that I can fix that).

    I have tried the code it that blog: dax.codemann8.com/.../Enum2Str.sql

    but, that code doesn't work for all enums, and seems to work only for enum that created in user level.

    i.e enum : SalesStatus doesn't work.

    Thanks :)

  • Community Member Profile Picture
    on at

    I would not directly read from modelelement table, if Microsoft changes the way they store properties for enums you are back to start.

    I also thought that Microsoft used to dump enums with their translations to a table when they use the information in cubes, but this could be ax 2009 logic.

    You could also use the meta data service, calling it from a .NET assembly in your database

  • Community Member Profile Picture
    on at

    May found some better solution - call an AX function from sql-server (that's I have done already). Because all the enum may repeated, I can read always from cache, without much time consuming (about 50,000 records per minutes overhead), but don't know whether that better. I didn't check solutions in sql-function much.

    If there is sql-function that may cause better performance, so it is of course a preferred solution (better than 50,000 records per minutes overhead).

    Thanks :)

  • Guy Terry Profile Picture
    28,924 Moderator on at

    If you have a table called SRSANALYSISENUMS, you may find it has the enums you want in it.

  • Community Member Profile Picture
    on at

    This is an empty table (i.e for salesStatus enum)

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    lebels are saved in table ModelElementLabel

    Select * from MicrosoftDynamicsAX_model.dbo.ModelElementLabel

    Select * from MicrosoftDynamicsAX_model.dbo.ModelElement

    where ElementType = 40

    --ElementType 40 mean BaseEnums

  • Jakob Bjerg-Heise Profile Picture
    on at

    We have researched all ISV tools in the market, and can recommend you one. Let us connect on LinkedIN. Not appropriate in this forum.

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    If this is not to be considered spam (which it seems to be, taking into account that all your posts are just about promoting your product and that Eitan asked 1.5 year ago), please explain how your product can be used to convert enum value from integer in SQL Server.

  • Community Member Profile Picture
    on at

    I'm the owner of the AbraAxapta blog listed above and I know this topic well.  Unfortunately I developed this solution years ago and many changes have happened to AX since then so further analysis and research may be needed to tweak the query in SQL.

    Querying SrsAnalysisEnums can work too, but as someone pointed out, not everything is there, which is why my goal in my blog was to find the complete source of enums. However, it's possible to force the enums you want in there. SrsAnalysisEnums will only have enums that exist on tables that are included in a Perspective object, and only after that Perspective's model has updated.  Only after then will you be able to find the Enums in that table.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans