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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 28.10.2006, 16:40   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Dynamics AX Geek: cross-references & find
Источник: http://AxGeek.spaces.live.com/Blog/c...DB13!136.entry
==============
One of the cool things in Axapta is that you can read and modify the actual source code (provided you have the source code license, of course). When working with a standard object you often need to know where and how it is used. This is where two essential tools come in: cross-references and the find-dialog.
 
Cross-References 
Cross references answer questions like "Where is this object used?" and "What objects is it using?". You access it by right clicking any object in the AOT, Add-Ins/Cross-Reference.
The key is to keep the references updated. The initial references are built during the installation (installation check list / update cross-reference). It is up to you to keep it updated when you later change or add objects to the AOT. You can do that periodically by right clicking the top AOT node, Add-Ins / Cross-reference / Update or you can have the system update the reference whenever you compile some code. To do that go to Menu Tools / Options / Button Compiler and activate the Cross-reference checkbox.
 
Find Dialog 
The find dialog is more powerful than you might think. The search text is actually a regular expression. The syntax for regular expressions in Axapta can be found under System Documentation / Functions / match. It is not quite as powerful as Unix users might be used to, but it’ll do.

The find dialog allows you to search not only methods, but “All  nodes”.
Properties for example can be found easily, if you know they are stored as text as Property blank(s)#Value.
 
Find all temp. tables: Go to Data Dictionary\Tables find “All nodes” containing text
 
Temporary *#Yes
 
Ever wondered why searching for static method calls or enum types didn’t return any results? Colons are treated as special characters in regular expressions, so to find them you have to escape them with a backslash
 
            InventDirection\:\:Receipt
 
finds all occurrences of InventDirection::Receipt in the selected scope.
 
The dialog even let’s you define your own filter code. Your code is actually compiled to a method called FilterMethod(). The method has four parameters:
 
  • str _treeNodeName
  • str treeNodeSource
  • XRefPath _path
  • ClassRunMode _runMode
 
You can define any filter you want, your source simply needs to return a boolean to indicate found / not found. For example to find all insert() methods that do not call super():
Go to Data Dictionary / Tables find methods named insert, then copy this into the source field:
 
TextBuffer tb = new textbuffer();
tb.setText(_treeNodeSource);
return !tb.find("super()");
 
The method is also useful to match or-conditions.   
 
TextBuffer tb = new textbuffer();
tb.setText(_treeNodeSource);
return tb.find("insert()") || tb.find("delete()");
 
Execute this find on the classes node to return all methods that call insert() or delete().




==============
Источник: http://AxGeek.spaces.live.com/Blog/c...DB13!136.entry
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
AX Developer tips: Dynamics AX Performance issue. Cross object references drawbacks. Blog bot DAX Blogs 0 14.07.2008 00:11
Dynamics AX: Dynamics AX 2009 & SQL Server 2008 Blog bot DAX Blogs 0 10.06.2008 21:08
Inside Dynamics AX 4.0: Usage Scenarios Blog bot DAX Blogs 0 04.10.2007 05:15
Dynamics AX Geek: Using lists & listIterators - 8 queens example Blog bot DAX Blogs 0 28.10.2006 16:40

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

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

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