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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 29.12.2007, 19:50   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
Ruslan Goncharov: Mandatory property for DialogField
Источник: http://rusgon.blogspot.com/2007/12/m...alogfield.html
==============

Usually in Dialog Forms it's unable to set mandatory property for Dialog Fields. The lack of this property sometimes annoyed me. At the end I've decided to eliminate this gap :-)

To expand the standard functionality you need to do the following steps:

1.Add mandatory() method into DialogField class:
X++:
// Created by GRR on 01.11.2005
void mandatory(boolean r)
{
    str name;
    // If properties exists then we are on server
    if (properties)
    {
        name = #Propertymandatory;
        if (! properties.exists(name))
            properties.add(name,true);
        properties.value(name,r);
    }
    else
        this.fieldControl().mandatory(r);
}
2. Add into unpack() method following lines:

X++:
case #PropertyMandatory:
    this.mandatory(unpackedProperties.valueIndex(i));
    break;
Now you may enjoy mandatory property in Dialog Forms.

This trick published in Axaptapedia too.

Источник: http://rusgon.blogspot.com/2007/12/m...alogfield.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
Старый 29.12.2007, 20:48   #2  
kashperuk is offline
kashperuk
Участник
Аватар для kashperuk
MCBMSS
Соотечественники
Сотрудники Microsoft Dynamics
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии 2011
Лучший по профессии 2009
 
4,361 / 2084 (78) +++++++++
Регистрация: 30.05.2004
Адрес: Atlanta, GA, USA
Здесь следует учитывать вот это

Цитата:
Mandatory property starts working only after a value is entered into the control. What this means is that if you simply press OK right after the dialog is opened, you won't receive an error (regular forms works this way too)
взято отсюда:
http://kashperuk.blogspot.com/2007/0...xtensions.html
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Ruslan Goncharov: A few words about sorting codes Blog bot DAX Blogs 0 18.02.2009 21:05
Ruslan Goncharov: Dynamic enabled() property for StringEdit and arrows Blog bot DAX Blogs 0 18.04.2008 20:05
Ruslan Goncharov: Sending message to user Blog bot DAX Blogs 0 26.01.2008 18:22
Ruslan Goncharov: How to clarify what happened with variables in AX Blog bot DAX Blogs 0 17.01.2008 15:40
Ruslan Goncharov: How to get the screenshots of all open windows in AX Blog bot DAX Blogs 0 12.01.2008 12:31
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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