14.08.2010, 01:05 | #1 |
Участник
|
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 |
Участник
|
К слову сказать, по моему скромному опыту перебирать объекты приложения (т.е., скажем, выбрать названия всех форм или идентификаторы всех классов) гораздо быстрее выходит через UtilElements, чем через иные механизмы отражения. А еще можно было простым поиском по всем узлам обойтись - искомый GUID вряд ли где повторяется
|
|