Dynamics AX - Apply range on combobox datasource / items
I just want to limit the records brought in the combobox based on some condition, say like which menu item opened the form. So specific rows should return开发者_JAVA百科.
I have no idea about the code, also tell which method/event to use, field's modified method, control's lookup ? or at Datasource ? Form or class ? which place among these are best for it?
Ax does not have a combobox where the list is based on a datasource - so find the code that uses table data to fill a combobox list and add your limit there.
I could provide a more specific answer if you described how your combobox is filled or what you mean by list of comboboxes or its current value
- Does that combobox have the Extended Data Type or Base Enum properties filled? If any of these properties are filled, find the associated baseEnum.
- Search the form for the combobox name - was it mentioned there?
If the combobox is filled automatically using an associated base enum, you can either create your own base enum or write code from scratch using the add
method.
Or just leave it as it is and add an error message where code uses a wrong value.
Read Axaptapedia article
Maybe you can use the SysFormEnumComboBox helper class?
For an example see this link. Or download an example here.
精彩评论