AXForum  
Zurück   AXForum > Microsoft Dynamics AX > DAX Blogs
DAX
Kennwort vergessen?
Registrieren Forum Rules Hilfe Benutzerliste Heutige Beiträge Suchen

 
 
Themen-Optionen Thema durchsuchen Ansicht
Alt 14.08.2010, 01:05   #1  
Blog bot ist offline
Blog bot
Участник
 
25.646 / 848 (80) +++++++
Registriert seit: 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, напишите личное сообщение администратору.
Alt 15.08.2010, 02:37   #2  
gl00mie ist offline
gl00mie
Участник
MCBMSS
Most Valuable Professional
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
Лучший по профессии 2011
Лучший по профессии 2009
 
3.684 / 5813 (201) ++++++++++
Registriert seit: 28.11.2005
Ort: Москва
Blog-Einträge: 3
К слову сказать, по моему скромному опыту перебирать объекты приложения (т.е., скажем, выбрать названия всех форм или идентификаторы всех классов) гораздо быстрее выходит через UtilElements, чем через иные механизмы отражения. А еще можно было простым поиском по всем узлам обойтись - искомый GUID вряд ли где повторяется
 

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
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

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Gehe zu

Рейтинг@Mail.ru
Alle Zeitangaben in WEZ +3. Es ist jetzt 17:42 Uhr.
Powered by vBulletin® Version 3.8.5 (Deutsch)
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.