![]() |
#1 |
Участник
|
How to add all descendant classes to a new project
Источник: http://alexvoy.blogspot.com/2009/12/...lasses-to.html
============== I bumped into the problem of a class compilation with no licence for X++ source code. Forward compile option is not enough to make my changes working. Thus I need to export-import all descendant classes as well as the class I changed - FormLetter in my case. I therefore have to add all these classes to my project. Natural laziness saved me again from this manual work. I hope this short job inspired by system class SysCompilerOutput and miklenew's job from AXForum will help you in similar situations. X++: // add to a new project all descendant classes for forward compilation public static void SISCreateCompileForwardProject(Args _args) { #AOT str project = 'SIS_CompileForward'; SysCompilerOutput sysCompilerOutput; Dictionary dictionary = new Dictionary(); DictClass dictClass = new DictClass(className2Id("Formletter")); int numOfClasses = dictionary.classCnt(); ProjectNode sharedProjects; ProjectNode newProject; void addToProjectForwardClass(DictClass _dictClass, Dictionary _dictionary, int _numOfClasses) { ClassNode classNode; DictClass dictClassLoop; DictClass childClass; int i; ; if (_dictClass) { classNode = infolog.findNode(#ClassesPath + #AOTDelimiter + _dictClass.name()); if (classNode) { newProject.addUtilNode(UtilElementType::Class, classNode.name()); for (i=1; i <= _numOfClasses; i++) { dictClassLoop = _dictionary.classObject(_dictionary.classCnt2Id(i)); if (dictClassLoop.extend() == _dictClass.id()) { childClass = new DictClass(dictClassLoop.id()); addToProjectForwardClass(childClass, _dictionary, _numOfClasses); } } } } } ; sharedProjects = infolog.projectRootNode().AOTfindChild('Shared'); sharedProjects.AOTAdd(project); newProject = sharedProjects.AOTfindChild(project); newProject.loadForInspection(); newProject = newProject.getRunNode(); addToProjectForwardClass(dictClass, dictionary, numOfClasses); newProject.AOTsave(); }
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
![]() |
#2 |
Участник
|
Хмм. Как же ж это ты без лицензии на Х++ код собрался этот джоб написать и еще и выполнить?
![]() |
|
![]() |
#3 |
Участник
|
а в чём собственно проблема-то? морфикс-то на борту имеется. лицензия на Х++ даёт возможность править классы без утомительного экспорта-импорта
__________________
Felix nihil admirari Последний раз редактировалось wojzeh; 27.10.2019 в 19:35. |
|