30.05.2013, 13:11 | #1 |
Участник
|
sashanazarov: Generate a project with application objects from "used by" cross-references
Источник: http://sashanazarov.blogspot.com/201...eferences.html
============== Sometimes one needs to investigate where some field or method is used in the AOT. There may be a long list of AOT paths in the "Used by" form, and having a project with all those application elements may be a good starting point. Add a button to xRefReferencesUsedByTypedTree form, set its Text property to "Create project" and MultiSelect to Yes: Override its clicked method and use the following code: X++: void clicked() { #TreeNodeSysNodeType XrefPaths xRefPathsLocal; Set treeNodeLocalPaths; SetEnumerator treeNodeLocalPathEnumerator; SysProjectFilterRunBase project; UtilElements utilElements; ProjectNode projectNode; Dialog dialog; DialogField dialogField; super(); treeNodeLocalPaths = new Set(Types::String); for (xRefPathsLocal = xRefPaths_ds.getFirst(true) ? xRefPaths_ds.getFirst(true) : xRefPaths_ds.cursor(); xRefPathsLocal; xRefPathsLocal = xRefPaths_ds.getNext()) { treeNodeLocalPaths.add(xRefPathsLocal.Path); } if (treeNodeLocalPaths.elements() == 0) { info("There are no AOT objects to create the project from."); return; } dialog = new dialog("Create project"); dialogField = dialog.addFieldValue( extendedTypeStr(ProjectName), 'UsedByProject'); if (dialog.run()) { projectNode = SysTreeNode::createProject(any2str(dialogField.value())); project = new SysProjectFilterRunBase(); project.parmProjectNode(projectNode); project.grouping(SysProjectGrouping::AOT); treeNodeLocalPathEnumerator = treeNodeLocalPaths.getEnumerator(); while (treeNodeLocalPathEnumerator.moveNext()) { utilElements = xUtilElements::findTreeNode( treeNode::findNode( SysTreeNode::applObjectPath( treeNodeLocalPathEnumerator.current())), false); if (utilElements.RecId != 0) { project.doUtilElements(utilElements); } } project.write(); } } Источник: http://sashanazarov.blogspot.com/201...eferences.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
Опции темы | Поиск в этой теме |
Опции просмотра | |
|