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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 14.08.2010, 01:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Dianne Siebold: Use X++ to Loop through the AOT
Источник: http://blogs.msdn.com/b/dsiebold/arc...h-the-aot.aspx
==============

Recently, I had a need to loop through the Forms node in the AOT and find any form that had a particular property value. I've seen a lot of examples that show you how to locate nodes in the AOT by name, but not by a property value. So I thought I would share the code that I wrote for the task.

For a little background, when you press F1 on a form in AX, it brings up a help topic for that form. Each form is hooked up to help via the HTMLHelpTopic property (and the HTMLHelpFile property if you want to get precise). To find this property you need to open the form in the AOT and then navigate to the Design node.



Here's the code that loops through the forms.

static void FindFormInAOT(Args _args)

{



#AOT

Treenode formNode;

Treenode form;

Form actualForm;

str HTMLHelpProperty;

str formName;

int i;

int nodeCount;

;

formNode = treenode::findNode(#FormsPath);

// Count of all the forms.

nodeCount = formNode.AOTchildNodeCount();

form = formNode.AOTfirstChild();



for (i=1; i1)

{

info("Form name is: " + formName);

break;

}

form = form.AOTnextSibling();

}

}

If successful, the code displays and Infolog window with the matching form name.








Источник: http://blogs.msdn.com/b/dsiebold/arc...h-the-aot.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
Старый 15.08.2010, 02:37   #2  
gl00mie is offline
gl00mie
Участник
MCBMSS
Most Valuable Professional
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
Лучший по профессии 2011
Лучший по профессии 2009
 
3,684 / 5788 (200) ++++++++++
Регистрация: 28.11.2005
Адрес: Москва
Записей в блоге: 3
К слову сказать, по моему скромному опыту перебирать объекты приложения (т.е., скажем, выбрать названия всех форм или идентификаторы всех классов) гораздо быстрее выходит через UtilElements, чем через иные механизмы отражения. А еще можно было простым поиском по всем узлам обойтись - искомый GUID вряд ли где повторяется
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Dianne Siebold: AX Tutorials in the AOT Blog bot DAX Blogs 0 05.12.2009 10:07
Dianne Siebold: Restart AOS When Service WSDL Contains an Enum Blog bot DAX Blogs 0 16.12.2008 06:09
Dynamics AX: In the spot light: Dianne Siebold's WebLog Blog bot DAX Blogs 0 17.09.2008 20:05
Dianne Siebold: AIF Top Ten Blog bot DAX Blogs 1 22.04.2008 11:19
axcoder: Dianne Siebold's blog Blog bot DAX Blogs 0 15.10.2007 15:22

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

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

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