Solved

Location of Enums in database

Posted on 2009-07-14
4
1,258 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Desired Skill Set for Microsoft Dynamics CRM Technical Resources – Part I
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

632 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