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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 11.11.2016, 04:26   #1  
Blog bot is offline
Blog bot
Участник
 
25,617 / 848 (80) +++++++
Регистрация: 28.10.2006
stoneridgesoftware: Version Control in Dynamics AX: Check-in a project and all of its pending objects
Источник: https://stoneridgesoftware.com/versi...nding-objects/
==============

There have been times in Dynamics AX, when I have had to check in a project that includes a lot of objects. Whenever we do a new design or bug fix we always create a project and then add in all the objects that we are making changes to. When completed, we check in the project and all objects with pending changes so they are all included in the same change set.

Sometimes you have a project that is very large and you also could have a lot of other pending objects. This can make the check-in a pain. You have to go through the whole list of pending objects and select the ones that you need. There is the potential of missing objects or selecting an object that isn’t part of the project and shouldn’t be part of check-in. To help resolve or make this easier I made a modification to version control.

Steps and examples to make this small change to the SysVersionControlCheckIn form are below:

1. Go to a project you want to check in. In this example, I have a project that is checked out and some objects that are also checked out.



2. Right-click on that project and select Check In
3. On the Check-in form all objects in the project that are checked out will also be checked to be included in check in.



This is an easy and quick way to check in a project and all the objects included in that project. Instead of having to manually select each one you want to include in the check in. This will also eliminate the possibility of selecting an object that shouldn’t be part of the check in.

To include this functionality there is a small addition to the form SysVersionControlCheckedIn.

In method setSelectedAotElements I added the call to the new method.

void setSelectedAotElements(){ LastAotSelection lastAotSelection = new LastAotSelection(); TreeNode treeNode; treeNode = lastAotSelection.first(); element.setSelected(treeNode == null); while (treeNode) { select forupdate item where item.ItemPath == treeNode.treeNodePath(); if (item) { item.Selected = true; item.update(); // BEGIN Select all items in a project - 10/20/2016 SSI EDM this.ssi_selectAllProjectItems(treeNode); // END Select all items in a project - 10/20/2016 SSI EDM } treeNode = lastAotSelection.next(); } sysVersionControlTmpItem_ds.executeQuery();}Created new method that will loop through the objects in a project and mark them to be checked in if the object is part of the pending object list. If the object being checked in is not a project this logic will be skipped.

/// /// method will search for project file for treeNode being checked in/// if project found it’ll loop through all project treeNodes and mark other pending objects for check in/// /// /// object being set for check in/// /// /// Mark all project objects for check in - 10/20/2016 SSI EDM/// private void ssi_selectAllProjectItems(TreeNode _treeNode){ // assign the project name ProjName projName = _treeNode.treeNodeName(); // get a list of shared projects ProjectListNode list = infolog.projectRootNode().AOTfindChild("@SYS71475"); ProjectNode pnProj; // search for project being checked in ProjectNode pn = list.AOTfindChild(projName); void searchAllObj(projectNode rootNode) { #TreeNodeSysNodeType TreeNode childNode; TreeNodeIterator rootNodeIterator; if (rootNode) { rootNodeIterator = rootNode.AOTiterator(); childNode = rootNodeIterator.next(); // loop through all childNodes of project while (childnode) { if (childNode.treeNodeType().id() == #NT_PROJECT_GROUP) { // childNode is a project group, search for next childNode searchAllObj(childNode); } else { // object found, check to see if object is checked out select forupdate item where item.ItemPath == childNode.treeNodePath(); if (item) { // object is checked out, mark for check in item.Selected = true; item.update(); } } // load next child childNode = rootNodeIterator.next(); } } } // check if project was found if (pn) { // project found, loop through project treeNodes pnProj = pn.loadForInspection(); searchAllObj(pnProj); pnproj.treeNodeRelease(); }}







Источник: https://stoneridgesoftware.com/versi...nding-objects/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


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

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

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