Get list of check out element from TFS in Microsoft Dynamics AX 2012
The purpose of this post is to find the list of element check out of the Application Object Tree from Team Foundation Server in Microsoft Dynamics AX 2012.
Sometimes it is very difficult to find which element is checked out. One way is to get the list is find at least one element which is checked out. And then right click on it and click on check in. It will open "sysVersionControlCheckIn" for which have list of elements which are checked out and pending to check in. Because there is no functionality to get the checked out element.
But what you do, when you are unaware of which element is checked out. Don't worry here is the solution for that, which can generate the list of elements in infolog by one click only
Make new job under the "Jobs" node in the application object tree, and paste the code written below.
static void getListCheckOutElement(Args _args)
{
SysVersionControlSystem vcs = versioncontrol.parmSysVersionControlSystem();
SysVersionControlTmpItem SysVersionControlTmpItem;
boolean IsCheckOut;
if(vcs)
{
SysVersionControlTmpItem.setTmp();
SysVersionControlTmpItem.setTmpData(vcs.getCheckedOutItems());
while select * from SysVersionControlTmpItem
{
info(strFmt("%1",SysVersionControlTmpItem.ItemPath));
IsCheckOut = true;
}
if(!IsCheckOut)
info("None element is check out");
}
}
Sometimes it is very difficult to find which element is checked out. One way is to get the list is find at least one element which is checked out. And then right click on it and click on check in. It will open "sysVersionControlCheckIn" for which have list of elements which are checked out and pending to check in. Because there is no functionality to get the checked out element.
But what you do, when you are unaware of which element is checked out. Don't worry here is the solution for that, which can generate the list of elements in infolog by one click only
Make new job under the "Jobs" node in the application object tree, and paste the code written below.
static void getListCheckOutElement(Args _args)
{
SysVersionControlSystem vcs = versioncontrol.parmSysVersionControlSystem();
SysVersionControlTmpItem SysVersionControlTmpItem;
boolean IsCheckOut;
if(vcs)
{
SysVersionControlTmpItem.setTmp();
SysVersionControlTmpItem.setTmpData(vcs.getCheckedOutItems());
while select * from SysVersionControlTmpItem
{
info(strFmt("%1",SysVersionControlTmpItem.ItemPath));
IsCheckOut = true;
}
if(!IsCheckOut)
info("None element is check out");
}
}
Run the job and get the list of checked out elements. Its a simple logic, but I found it very useful while development and deployment. Try it, I am sure you can also feel ease of use it. Another addition is you can do is create menu item for this job and put it in any menu, from which you can easily access it. So you have to now just clicked on a button and you have the list of all checked out elements from team foundation server.
Cheers...
Comments
Post a Comment