web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / AX Dev Help / Hide Enum values in Form Co...

Hide Enum values in Form Control

Gaurav Pandey Profile Picture Gaurav Pandey 960

Hide Enum values in Form Control :
Well there are various situations where you  want to show only subset of Enum values :
How to do it :
Well add below , In Class declaration of form
public class FormRun extends ObjectRun
{
    SysFormEnumComboBox         sysFormEnumComboBox;
    Set                         enumSet;// = new Set(Types::Enum);
}

Add below piece of code in Form’s init method :
public voidinit()
{
    enumSet= newSet(Types::Enum);
    enumSet.add(Enum::A);
    enumSet.add(Enum::B);
    enumSet.add(Enum::C);
    enumSet.add(Enum::D);
   
    sysFormEnumComboBox  = sysFormEnumComboBox::newParameters(element,element.controlId(formControlStr(Form,control)),enumNum(enum),enumSet);
    super();
  
}

Well, Please have a deep look on second Argument ,which is control ID.

This was originally posted here.

Comments

*This post is locked for comments