you get the result correct, but you change the language temporay for the session.
I have solved the problem in the following manner:
add this method to the class "SysDictEnum":
LabelId Value2LabelLabel(int value)
{
#Properties
SysDictEnum SysDictEnum;
TreeNode treeNode;
;
return findProperty(this.treeNode().AOTfindChild(this.value2Symbol(value)).AOTgetProperties(),#PropertyLabel);
}
You can test it with this job:
static void Job2(Args _args)
{
sysDictEnum sysDictEnum = new SysDictEnum(EnumNum(LedgerAccountType));
LabelId labelId;
;
LabelId = sysDictEnum.Value2LabelLabel(LedgerAccountType::AccountCost);
info(labelId);
info(SysLabel::labelId2String2(labelId, 'en-us'));
info(SysLabel::labelId2String2(labelId, 'nl'));
info(SysLabel::labelId2String2(labelId, 'fr'));
}
yf
/Jesper
-------- Original Message --------
Subject: [development-axapta] Re: LabelId's from Enum Values (04-Nov-2004 15:12)
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
>
>
>
> original i want to get the labelid in format @SYSxxxx to translate it
> into an other language.
>
> with
>
> LanguageId orglanguageId = infolog.language();
> senum = new SysDictEnum( 53 );
> infolog.language('en-us');
> lid = senum.value2Label(1);
> infolog.language(orglanguageId);
>
> i get the labeltext in the correct language without using the labelid.
>
> But thanx for support :-)
> Ben
>
> --- In [EMAIL PROTECTED], "onnobid" <[EMAIL PROTECTED]>
> wrote:
> >
> > ???
> >
> > in previous post you asked for label id in format @SYSxxx.
> > Value2Label() returns the label but not the id of the label. What do
> > you really mean now?
>
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
> To: [EMAIL PROTECTED]
Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.