Introduction
In Dynamics AX, you can use valueStr to get the string value of a ComboBox control on a Form. In Axapta 3.0 SP1, this method doesn’t exist.
Example in Dynamics AX 2009
- Create a new form.
- Add a ComboBox control in the Design node.
- Set property EnumType of the added ComboBox to ProjType.
- Set property AutoDeclaration to Yes for the added ComboBox.
- Add a Button control in the Design node.
- Override the Clicked method of the Button control as follows:
void clicked()
{
super();
info(ComboBox.valueStr());
}
In Dynamics AX 2009, you’ll get the value of the EnumType as string.
Equivalent in Axapta 3.0 SP1
Unfortunately, this ain’t working in Axapta 3.0 SP1.
To achieve the same in Axapta 3.0 SP1, override the Clicked method of the Button control as follows:
void clicked()
{
super();
info(
new
SysDictEnum(
enumnum(ProjType)).index2Name(
ComboBox.selection()));
}
Post a Comment