Solved

Location of Enums in database

Posted on 2009-07-14
4
1,247 Views
Last Modified: 2012-05-07
Hi all,

In my Microsoft Dynamics AX application i record activities for staff. Each activity has an activity type which is an Enum (e.g. 0=Task, 1=Appointment etc.)

I am currently developing a report to upload to the Sql Server 2005 Reports server so the users can jump onto the website and see the report but the problem is that the database records the activity type as a numerical value. (records 1 instead of Appointment)

What i want to know is where do i look to find the "meaning" for the numerical value so i can display 'Appointment' instead of '1'
0
Comment
Question by:M3mph15
  • 2
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
quale-kaizen earned 500 total points
ID: 24857552
For now (AX version 5) the metadata is not kept on the DB.

One option would be to create a static method in X++ to retrieve the label from the enum value.
You should be able to call X++ methods from your report.

Regards,
QK
static void Job1(Args _args)
{
    sysDictEnum sysDictEnum;
    int _enumValue = 1;  
    ;
 
 
    sysDictEnum = new sysDictEnum(enumnum(salesStatus));
 
    info(sysDictEnum.value2Label(_enumValue));
}

Open in new window

0
 
LVL 6

Author Comment

by:M3mph15
ID: 24865392
Ah ok. That sucks. How would I call X++ methods from my report?
0
 
LVL 7

Expert Comment

by:quale-kaizen
ID: 24867356
0
 
LVL 6

Author Closing Comment

by:M3mph15
ID: 31603568
I didn't get to the complete solution but my original question was where the Enums were stored.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question