Показать сообщение отдельно
Старый 29.12.2007, 19:50   #1  
Blog bot is offline
Blog bot
Участник
 
23,342 / 790 (73) +++++++
Регистрация: 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, напишите личное сообщение администратору.