06.05.2014, 01:16 | #1 |
Участник
|
Kashperuk Ivan: Q&A session: Working with MorphX project nodes from code
Источник: http://kashperuk.blogspot.com/2014/0...x-project.html
============== I had some spare time today, so started answering some of the comments I had through the blog and through e-mail. I decided I'll just open up a new section on my blog, called Questions and Answers, in which I will slowly answer the questions from my backlog: Question (related to post about the DEV_CreateNewProject tool for AX): So could create ConfigKeys Macro and I wanted, and could throw them into the project that was created, but I can not throw them within their respective nodes, so they are loose in the project, you can help me put them within your nodes?To summarize, Gustavo wanted to create some AOT elements from code (specifically, configuration keys and macros), and add them to a new project into respective groups, similar to how it is done in DEV_CreateNewProject tool. I wrote a small job that does that, and can be downloaded from my OneDrive. The code is also pasted and explained below: X++: static void Tutorial_CreateProjWithGroupAndElement(Args _args) { ProjectListNode treeNodeProject; ProjectNode upgradeNode; ProjectGroupNode child; MacroBuild macro; #AOT str projName = @"Project01"; str groupName = @"macroGrp"; str macroName = @"macro01"; treeNodeProject = SysTreeNode::getPrivateProject(); treeNodeProject.AOTadd(projName); upgradeNode = treeNodeProject.AOTfindChild(projName); upgradeNode = upgradeNode.getRunNode(); upgradeNode.AOTadd(groupName); child = upgradeNode.AOTfindChild(groupName); child.projectGroupType(GroupNodeType::Macros); macro = new MacroBuild(macroName, true); macro.addSource(@"isConfigurationkeyEnabled(configurationkeynum(WMSAdvanced))"); macro.save(); child.addUtilNode(UtilElementType::Macro, macroName); upgradeNode.AOTsave(); }
You can see the results immediately after executing the job. Источник: http://kashperuk.blogspot.com/2014/0...x-project.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. Последний раз редактировалось mazzy; 07.05.2014 в 10:40. |
|
|
За это сообщение автора поблагодарили: wojzeh (1). |
|
|