just use int2str.
Enum are represented internally as integers.
Try:
info(strfmt("No is %1, Yes is %2",
int2str(NoYes::No),
int2str(NoYes::Yes)));
and you'll get:
No is 0, Yes is 1
Pls be careful not to litter your code by using explicit integer
constants. As a rule you should only use the defined literals.
Have a nice day
Alex
--- In development-axapta@yahoogroups.com, "Mike Savage" <[EMAIL PROTECTED]>
wrote:
>
> Thanks Yavuz
>
> I was thinking more of how do I do it from within a class, for example.
>
> In the class I would have LedgerAccountType::AccountRevenue, but how,
> from there, do I determine the element id via a function?
>
> Cheers
>
>
> Mike Savage
> Sense Enterprise Solutions Ltd
>
> -----Original Message-----
> From: development-axapta@yahoogroups.com
> [mailto:[EMAIL PROTECTED] On Behalf Of Yavuz YILDIZ
> Sent: 24 April 2006 12:25
> To: development-axapta@yahoogroups.com
> Subject: Re: [development-axapta] ENUM Element
>
> Login to Axapta as Administrator and open AOT. Select Data
> Dictionary\Base Enums. You can
> see that enum values.
>
> --- Mike Savage <[EMAIL PROTECTED]> wrote:
>
> > Hi.
> >
> >
> >
> > How do I determine which element of an enum an enum element is in
> code?!
> >
> >
> >
> > I.e. LedgerAccountType::AccountRevenue = ??
> >
> >
> >
> >
> >
> > Enum2Value seems to return the string not the element id!!
> >
> >
> >
> >
> >
> > Cheers
> >
> >
> >
> >
> >
> >
> >
> > Mike Savage
> > Sense Enterprise Solutions Ltd
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
>
>
> Yavuz YILDIZ
> ERP Developer
> Star Group Glass Processing
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
>
>
>
>
> Yahoo! Groups Links
>
YAHOO! GROUPS LINKS
- Visit your group "development-axapta" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.