I referred the blog axwiki.blogspot.in and get this idea,
Main task is Removing some of the elements from Enum value that are not needed. Example WeekDays is one of the Enum in AX. It shows name of 7 days in the Week. Here I want to show only 3 days. How I do,
By using one of the Ax class "SysFormEnumComboBox" we can get.
We want to follow some steps:
Step 1:
Create a new form . Add a ComboBox control under design node in the form.Then set the property of control EnumType --> Weekdays and AutoDeclaration-->Yes.
Step 2:
Write the code in form level init() method,
public void init()
{
SysFormEnumComboBox sysFormEnumComboBox;
Set enumSet = new Set(Types::Enum); // collection of selected values.
enumSet.add(WeekDays::Monday);
enumSet.add(WeekDays::Wednesday);
enumSet.add(WeekDays::Friday);
SysFormEnumComboBox = SysFormEnumComboBox::newParameters(element,
super();
}
SynTax for SysFormEnumComboBox is,
SysFormEnumComboBox::newParameters(FormRun _FormRun, ComBocontrolId,EnumId,set);
So here,
HideEnumValue-->FormName
HideEnumValueControl-->ComBoxControlName
WeekDays-->BaseEnum
enumset-->Variable of Set.
The output Screen is,
Main task is Removing some of the elements from Enum value that are not needed. Example WeekDays is one of the Enum in AX. It shows name of 7 days in the Week. Here I want to show only 3 days. How I do,
By using one of the Ax class "SysFormEnumComboBox" we can get.
We want to follow some steps:
Step 1:
Create a new form . Add a ComboBox control under design node in the form.Then set the property of control EnumType --> Weekdays and AutoDeclaration-->Yes.
Step 2:
Write the code in form level init() method,
public void init()
{
SysFormEnumComboBox sysFormEnumComboBox;
Set enumSet = new Set(Types::Enum); // collection of selected values.
enumSet.add(WeekDays::Monday);
enumSet.add(WeekDays::Wednesday);
enumSet.add(WeekDays::Friday);
SysFormEnumComboBox = SysFormEnumComboBox::newParameters(element,
element.controlId(formControlStr(HideEnumValue, HideEnumValueControl)), enumName2Id(enumStr(WeekDays)), enumSet);
super();
}
SynTax for SysFormEnumComboBox is,
SysFormEnumComboBox::newParameters(FormRun _FormRun, ComBocontrolId,EnumId,set);
So here,
HideEnumValue-->FormName
HideEnumValueControl-->ComBoxControlName
WeekDays-->BaseEnum
enumset-->Variable of Set.
The output Screen is,
No comments:
Post a Comment