Solved

Location of Enums in database

Posted on 2009-07-14
4
1,237 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now