comboboxenumsaxaptax++dynamics-ax-2012

Get value from ComboBox?


I have in MyForm a ComboBox (myComboBox ) with EnumType myEnumType .

In the modified method , I want to get the value.

I used the code looklike:

if (myComboBox.enumTypeValue() == myEnumType::Value1 )
{
//action
}

Or anothe way

if (myComboBox.enumType(myEnumType::Value1) )
{
//action
}

In both cases I can not take the value.

What is the way? Thanks, all!

Enjoy!


Solution

  • To get the value of the ComboBox use the selection method,

    if(myComboBox.selection() == myEnumType::Value1) {
       //action
    }