28.04.2008, 19:05 | #1 |
Участник
|
Kashperuk Ivan: SysFormEnumComboBox - class allowing to show only some of the values for a comboBox
Источник: http://kashperuk.blogspot.com/2008/0...lowing-to.html
============== In Microsoft Dynamics AX 2009, a new class has been created, that got my attention recently after yet another question about this sort of thing was asked by a fellow Dynamics AX developer. Often enough, we need to restrict the user selection from a particular ComboBox. Creating a new BaseEnum specifically for this purpose is a really cumbersome solution, which later might lead to problems of maintenance. Originally, the SysFormEnumComboBox was designed to be used on forms to provide for this behavior. I modified the class slightly to allow for usage in RunBase Framework classes. To demonstrate, how this class can be used, I modified the tutorial_RunBaseForm class and form, showing both scenarios: adding the control from the dialog method of the class, as well as adding it manually in the form design and methods. To use this class, you need to know only one static method: X++: public static SysFormEnumComboBox newParameters( FormRun _formRun, int _comboBoxControlId, enumId _enumId, Set _allowedEnumValuesSet, Form _form = null) X++: sysFormEnumComboBox = SysFormEnumComboBox::newParameters(element,
control::ComboBoxOnForm,
enumnum(InventTransType),
enumSet); You can download the project for versions 4.0 and 2009 of Microsoft Dynamics AX through the following link: download P.S. It is also worth mentioning, that this class does not provide support for grids. It requires a stand-alone control, not bound to a database table field. Источник: http://kashperuk.blogspot.com/2008/0...lowing-to.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
Опции темы | Поиск в этой теме |
Опции просмотра | |
|