Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Unanswered

Filter base enum values on the unbound combo box control in a custom form on runtime using x++ code

Posted on by
Hi Experts!
 
I created a simple form with dialog-basic pattern design having no datasource and want to filter base enum values on combo box control but on the basis of previous selected value on a form string control field on runtime using x++ code. I have used class SysFormEnumComboBox in form init method, but I want to work it on runtime. Any body knows how to achieve it, also do I need to mention base enum name on unbound combo box control properties?
 
        SysFormEnumComboBox     sysFormEnumComboBox;
        Set enumSet = new Set(Types::Enum); // collection of selected values.
   
        enumSet.add(CustomEnum::Invoice);
        enumSet.add(CustomEnum::Purchase);
  
    
        SysFormEnumComboBox = SysFormEnumComboBox::newParameters(element, element.controlId(formControlStr(CustomForm, ComboBoxCtrl)), enumName2Id(enumStr(CustomEnum)), enumSet,"Type");
    
        super();
        SysFormEnumComboBox.select(CustomEnum::Purchase); // To select value in combo
 
Base Enum Type.png
  • Anton Venter Profile Picture
    Anton Venter 9,343 Super User on at
    Filter base enum values on the unbound combo box control in a custom form on runtime using x++ code
    Hello,
     
    The image file you attached cannot be opened. Can you insert a screenshot instead? 

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans