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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 19.06.2012, 18:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
axblog4u: Generating Lookups using SysAttributes Class – Dynamics AX2012
Источник: http://axblog4u.wordpress.com/2012/0...namics-ax2012/
==============


Case Study: In earlier or current release we have different ways of displaying lookups using table lookup, field group lookups, building reference lookup from custom form using FormAutoLookupFactory.

Building custom lookups for displaying AOT elements using SysModelElements/UtilElementsId was usually performed by Query/QueryBuildDataSource instead we can generate same using SysAttribute . Similiar type of functionality is implemented across AX2012 and one such instance is usage of attribute for displaying Workflow queues.



Design Approach: We are building runtime lookup by checking attributes whose values are ‘True’ and adding to the temporary table. This way we would display all the classes which has the following attribute syntax:

[SysClassEnabledAttributes(boolean::true, classStr(SysEnabledDocument))]

Where SysClassEnabledAttributes is a attribute base class which extends SysAttribute which helps us to build the required lookup.

Code Pattern:


/// /// Finds the classes that extend the /// SysEnabledAttributes class that are queue enabled./// /// /// A SysAttributeTmp table buffer./// public static SysAttributeTmp getAllAttributes(){ #define.sysAttribute("SysClassEnabledAttributes") SysAttributeTmp attributes; List list; SysDictClass dictClass; DictClass currentClass; ListEnumerator listEnumerator; boolean flag = true; SysClassEnabledAttributes attribute; dictClass = new SysDictClass(classNum(AbstractAttributesClass)); listEnumerator = new ListEnumerator(); list = dictClass.extendedBy(); listEnumerator = list.getEnumerator(); while (listEnumerator.moveNext()) { currentClass = new DictClass(listEnumerator.current()); attribute = currentClass.getAttribute(#sysAttribute); if (attribute != null) { flag = attribute.parmFlag(); if (flag) { attributes.Name = dictClass.name(); attributes.Description = attribute.parmName(); attributes.insert(); } } } return attributes;}Please check out for the design implementation in the shared location. Happy Attributing AX2012
SharedProject_Lookup_Attributes




Tagged: field group

Источник: http://axblog4u.wordpress.com/2012/0...namics-ax2012/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axblog4u: Display Web Image Content in Forms using Dynamics AX2012 Blog bot DAX Blogs 0 28.05.2012 19:12
axblog4u: Dynamics AX2012: Create Custom Service using X++ Blog bot DAX Blogs 0 24.01.2012 21:11
axblog4u: Dynamics AX2012: Table Full Text Indexes Blog bot DAX Blogs 0 26.09.2011 13:11
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22:11
CRM DE LA CREME! Configuring Microsoft Dynamics CRM 4.0 for Internet-facing deployment Blog bot Dynamics CRM: Blogs 0 18.08.2009 11:05

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

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

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