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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 07.03.2009, 00:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
axStart: Check if the table field is mapped.
Источник: http://axstart.spaces.live.com/Blog/...C0A0!482.entry
==============


Let’s have a look at the next scenario:
•             I have added a new field on my table map.
•             This new field not used on al the tables that use this table map.
•             I use this mapped field inside my table method.
 
If you don’t check it, you get an error about field ID is zero and you are not in the mood to check for all places where this method is use. And you don't want to change AX on all those places
 
Solution:
TreeNode::findNode(#TableMapsPath+'\\Map\\Mappings\\'+tableid2name(this.TableId)+'\\Field');
If the TreeNode exist the field is not mapped.
 
Example:
 
public static void initMapFromMap(AddressMap _toAddress,
                                  AddressMap _fromAddress)
{
   #AOT
    _toAddress.Address          = _fromAddress.Address;
    _toAddress.Street           = _fromAddress.Street;
    _toAddress.ZipCode          = _fromAddress.ZipCode;
    _toAddress.City             = _fromAddress.City;
    _toAddress.County           = _fromAddress.County;
    _toAddress.State            = _fromAddress.State;
    _toAddress.CountryRegionId  = _fromAddress.CountryRegionId;
    if(TreeNode::findNode(#TableMapsPath+'\\AddressMap\\Mappings\\'+tableid2name(_toAddress.TableId)+'\\Telex') &&
       TreeNode::findNode(#TableMapsPath+'\\AddressMap\\Mappings\\'+tableid2name(_fromAddress.TableId)+'\\Telex'))
           _toAddress.Telex            = _fromAddress.Telex;
}
 


Источник: http://axstart.spaces.live.com/Blog/...C0A0!482.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
palleagermark: Dealing with changed table or field id's Blog bot DAX Blogs 0 11.02.2009 11:05
axStart: table & field ID conflicts Blog bot DAX Blogs 0 29.05.2008 17:05
axStart: How to convert a column in a table to a different type with the same name without losing data. Blog bot DAX Blogs 0 01.02.2008 21:21
casperkamal: Adding a Table field through X++ code in Dynamics Ax Blog bot DAX Blogs 1 02.04.2007 17:05
Говорят вышел SP2 для Axapta 3. Кто нибуть что знает на эту тему? soin DAX: Прочие вопросы 10 13.10.2003 10:43
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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