![]() |
#1 |
Участник
|
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, напишите личное сообщение администратору. |
|
|
|