Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Location of Enums in database

Posted on 2009-07-14
4
Medium Priority
?
1,266 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 1500 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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.

722 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