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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 13.02.2009, 02:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,631 / 848 (80) +++++++
Регистрация: 28.10.2006
axaptapedia: Table Methods Generator
Источник: http://www.axaptapedia.com/Table_Methods_Generator
==============

Summary: Fixed wrong link to Coding Standards: X++ Layout

Table Methods Generator is tool for automated creating table methods find(), exist(), checkExist() and txtNotExist(). Because it is [http://msdn.microsoft.com/en-us/libr...44(AX.10).aspx Best Practice] to create these methods on every table with unique index, that is quite frequent task. This tools tries to minimize developers' handwork.

[[Image:TMG_find.gif|thumb|Table Methods Generator]]

==Download==
[http://www.axaptapedia.com/images/8/...erator_0.1.zip Table Methods Generator 0.1]

==Features==
*Simple to use
*Supports multiple tables in single run
*Supports unlimited number of fields in composite indexes
*Quick access to generated code using Infolog actions
*Generated methods complies with [http://msdn.microsoft.com/en-us/libr...44(AX.10).aspx Best Practices]

==Usage==
After adding menu item to context menu (see [[#Installation|Installation]]), simply select one or more tables in [[AOT]], open [[context menu]] and click on item "Generate table methods". For every table generator tries to find property ''PrimaryIndex'' and generate methods find(), exist(), checkExist() and txtNotExist(). Existing methods are skipped. Result is written to Infolog and InfoActions are used for quick access to code or table object.

==Installation==
At first, import downloaded XPO file to Dynamics AX. Installation XPO does not contain any standard objects (objects existing in standard application), therefore no conficts through import are expected. On the other hand, integration to context menu must be done manually.
#Add menu item DEV_TableMethodsGenerator to menu SysContextMenu
#Restrict visibility of menu item by editing [[SysContextMenu class]], method verifyItem(). Job DEV_TMG_installationNotes contains appropriate code.

==Detailed description==
Table Methods Generator is tool for automated creating some table methods in Microsoft Dynamics AX enviroment. These methods are used for finding record by primary index or checking existence of the record. [http://msdn.microsoft.com/en-us/libr...44(AX.10).aspx Best Practices for Table Methods] demands to create them on tables with unique key.
These methods are:
*find()
*exist()
*checkExist()
*txtNotExist()
All these methods are created by Table Methods Generator. They can be generally used without changes but for txtNotExist() is necessary to create label manually.
Generated methods complies with [http://msdn.microsoft.com/en-us/library/aa658028.aspx Best Practices for Dynamics AX Development], specifically with best practices for find(), exist() and X++ Layout (see [[#References|References]]).

Fields used for searching in the database are defined by index. This index must be set in property ''PrimaryIndex'' on proper tables during methods generating.

Existing methods are preserved. Because method checkExist() uses methods exist() and txtNotExist(), compilation issues can appear if these methods already exists and they have another signature then is expected.

===Supported Dynamics AX versions===
*Developed in Dynamics AX 4.0 SP2
*Tested in Dynamics AX 2009

===Using InfoActions===
InfoActions helps user to do actions directly from Infolog. Table Methods Generator uses InfoActions in two different situations:
# ''Error messages'': If it is possible, InfoAction is used for opening proper table in [[AOT]]. It is particularly useful if you are working with multiple tables.
# ''Methods list'': Names of newly created as well as existing methods are written to Infolog. In both cases it is possible to use InfoAction for opening content of the method.

===Labels===
Instead of labels are used hard-coded English texts.

===Customization===
There is no configuration available for Table Methods Generator. Of course, you can change source code easily. For example, if you do not want to generate checkExist() method, simply remove appropriate line from class DEV_TableMethodsGenerator, method initMethods().

==References==
*[http://msdn.microsoft.com/en-us/library/aa658028.aspx MSDN: Best Practices for Dynamics AX Development]
*[http://msdn.microsoft.com/en-us/libr...44(AX.10).aspx MSDN: Best Practices for Table Methods]
*[http://msdn.microsoft.com/en-us/libr...93(AX.10).aspx MSDN: static find Method Design Pattern]
*[http://msdn.microsoft.com/en-us/libr...21(AX.10).aspx MSDN: static exist Method Design Pattern]
*[http://msdn.microsoft.com/en-us/library/aa619943.aspx MSDN: Coding Standards: X++ Layout]


[[Category:Development tools]]


Источник: http://www.axaptapedia.com/Table_Methods_Generator
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axaptapedia: Go To Main Table Blog bot DAX Blogs 0 15.08.2007 19:40
axaptapedia: Export a table to Excel Blog bot DAX Blogs 0 27.04.2007 11:10
axaptapedia: Export a table to Excel Blog bot DAX Blogs 0 12.04.2007 16:10
axaptapedia: Change table owner Blog bot DAX Blogs 1 22.03.2007 20:56
axaptapedia: Change table owner Blog bot DAX Blogs 0 12.03.2007 17:30

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 20:05.