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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 01.12.2009, 21:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
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, напишите личное сообщение администратору.
Старый 02.12.2009, 10:11   #2  
kashperuk is offline
kashperuk
Участник
Аватар для kashperuk
MCBMSS
Соотечественники
Сотрудники Microsoft Dynamics
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии 2011
Лучший по профессии 2009
 
4,361 / 2084 (78) +++++++++
Регистрация: 30.05.2004
Адрес: Atlanta, GA, USA
Хмм. Как же ж это ты без лицензии на Х++ код собрался этот джоб написать и еще и выполнить?
Старый 02.12.2009, 19:15   #3  
wojzeh is offline
wojzeh
Участник
Аватар для wojzeh
Соотечественники
 
677 / 517 (19) +++++++
Регистрация: 27.04.2006
Адрес: Montreal
Цитата:
Сообщение от kashperuk Посмотреть сообщение
Хмм. Как же ж это ты без лицензии на Х++ код собрался этот джоб написать и еще и выполнить?
а в чём собственно проблема-то? морфикс-то на борту имеется. лицензия на Х++ даёт возможность править классы без утомительного экспорта-импорта
__________________
Felix nihil admirari

Последний раз редактировалось wojzeh; 27.10.2019 в 19:35.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Dynamics Mobile: How to code your own barcode enabled tasklets (Motorola and Intermec devices) Blog bot DAX Blogs 1 03.06.2014 06:34
chrisfie: Project Server 2007 TechNet Webcasts recordings and decks Blog bot DAX Blogs 0 21.07.2009 10:05
Передача функции в качестве параметра lemchey_white DAX: Программирование 20 21.01.2008 22:51
axStart: How to work with big projects with multi add-ons Blog bot DAX Blogs 0 30.12.2007 16:30

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

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

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