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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 19.06.2015, 21:14   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
sashanazarov: Looking for EDTs with broken table relations
Источник: http://sashanazarov.blogspot.com/201...ken-table.html
==============

The other day I found a couple of EDTs with broken table relations and wrote a script that found even more EDTs with the same problem.

Broken relations look like this:


staticvoid findBrokenRelationsInEDTs(Args _args)
{
#AOT
#TreeNodeSysNodeType

TreeNodeIterator iterator;
TreeNode edtTreeNode;
TreeNode relationsNode;
TreeNode relationNode;
;

iterator = TreeNode::findNode(#ExtendedDataTypesPath).AOTiterator();
if (iterator == null)
{
throw error("Cannot create tree node iterator");
}

edtTreeNode = iterator.next();

while (edtTreeNode != null)
{
relationsNode = edtTreeNode.AOTfindChild('Relations');

if (relationsNode.AOTchildNodeCount() == 0
|| edtTreeNode.AOTname() like "DEL_*")
{
edtTreeNode = iterator.next();
continue;
}

relationNode = relationsNode.AOTfirstChild();

while (relationNode != null)
{
if (relationNode.sysNodeType() == #NT_DBTYPENORMALREFERENCE
&& (relationNode.AOTgetProperty('Table') == ''
|| relationNode.AOTgetProperty('RelatedField') == ''))
{
error(edtTreeNode.AOTname());
break;
}

relationNode = relationNode.AOTnextSibling();
}

edtTreeNode = iterator.next();
}
}
Output:




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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
sashanazarov: Table inheritance and collection objects Blog bot DAX Blogs 11 15.02.2017 16:53
sashanazarov: Mandatory fields and table hierarchies Blog bot DAX Blogs 0 22.03.2013 16:11
ax-erp: ReferenceTable & Table References on EDT Blog bot DAX Blogs 0 18.12.2012 02:11
sashanazarov: Figuring out where some table field is modified Blog bot DAX Blogs 0 10.09.2012 23:15
sashanazarov: How one new table relation may break your code somewhere Blog bot DAX Blogs 0 07.09.2012 14:11

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

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

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