Wednesday, February 22, 2017

add run time enum to combo box Dynamics Ax 2012 R3

public void init()
{
    SysFormEnumComboBox     sysFormEnumComboBox;
    Set enumSet = new Set(Types::Enum); // collection of selected values.


            enumSet.add(EnumName::None);
            enumSet.add(EnumName::one);
            enumSet.add(EnumName::two);
            enumSet.add(EnumName::three);
            enumSet.add(EnumName::four);
            enumSet.add(EnumName::five);
         
     

    SysFormEnumComboBox = SysFormEnumComboBox::newParameters(element,
        element.controlId(formControlStr(Formname, comboboxname)),  enumName2Id(enumStr(EnumName)), enumSet);

    super();
    SysFormEnumComboBox.select(EnumName::None); // To select value in combo
}

D365FO. Dynamics 365 fiance and operation. Get and update contract of batch job on Controller run method. ax 2012

set Batch id in contract if batch isInBatch check is true in run method we will update the contract and set the batch id. class BrFunc...