AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 29.06.2017, 02:18   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
dynamicsaxhints: Bug: SysFormEnumComboBox selection method returns wrong value
Источник: http://dynamicsaxhints.blogspot.com/...selection.html
==============

The SysFormEnumComboBox class is very useful when only some of enum values must be enabled in a form, but it has a bug.

Problem description
The SysFormEnumComboBox.selection() method returns correct value only when being called after super() of form run method.
Test form is attached.
In form init method SysFormEnumComboBox is initialised with 3 enum values, Invoiced value is set as default and selection method is called:

In form run method selection method is called before and after super():

The results are:
init method, after super, SalesStatus selection is 255.
run method, before super, SalesStatus selection is 255.
run method, after super, SalesStatus selection is 3.

Hints
It appeared that FormComboBoxControl texts are set in form run method. Alternative approach must be used to get enum selection.

Solution
1. Add a new map comboBoxItem2EnumValueMap to classDeclaration:

2. Initialise and fill map in init method:

3. Use map in selection method:
The results are:
init method, after super, SalesStatus selection is 3.
run method, before super, SalesStatus selection is 3.
run method, after super, SalesStatus selection is 3.
The solution is also attached.

Источник: http://dynamicsaxhints.blogspot.com/...selection.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
dynamicsaxhints: What is wrong: crossCompany update job in AX 2012 Blog bot DAX Blogs 0 27.03.2017 11:11
Navigate Into Success: Try..Catch for .NET Interoperability Blog bot Dynamics CRM: Blogs 0 29.10.2014 09:00
Bug: One character in dialog field label causes wrong redrawing Blog bot DAX Blogs 0 24.01.2014 01:15
Sample Design Patterns: SysDictClass method implementedBy() returns as if class implements itself Blog bot DAX Blogs 0 25.10.2007 05:44
Sample Design Patterns: SysDictClass method implementedBy() returns as if class implements itself Blog bot DAX Blogs 0 11.10.2007 22:40
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 04:10.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.