web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

.XPO Deployment tracking system

(0) ShareShare
ReportReport
Posted on by

Hi Everyone, 

I am just developing "Xpo deployment tracking system" .and i found difficulty to fetch version id of the of the object. using object name as args value so that it can give you the version information.

Requirement are needed as mentioned below?

1. You can see the screen shot , in this form i want to insert the New version id, Old version id Old change number and New change number.

2. I want to open the version history form(SysVersionControlItemHistory) by passing Object name on click of the menuItem button as given "version history" on the form it should pop up as same as it pop-up on the right click on the object and choose history

DeploymentTrackingSystem.PNG

Can anyone please help me to achieve this requirement?

Regards,

Pankaj Kumar

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    TFS is not versioning the actual objects. In the history you can only see Changeset number that has been allocated to the group of objects for which it has been checked in. If you check the SysVersionControl* classes, you can see how AX is running a query for example for the Changeset history form which could be opened from the Version Control menu item.

    It is using the TFS integration DLLs, for which you could navigate up and down on the topics available in the documentation below to get some ideas:

    [View:https://msdn.microsoft.com/en-us/library/bb286958:750:50]

    For AX they also wrote a wrapper VS project which does these calls, if I remember it right then it is also available in the AOT, that is being called by the classes.

    You could use those references easily to implement your "versioning" history, I also did a couple of customizations in this area that you could read up on my blog, to filter/fetch specific changesets only for example:

    https://www.daxrunbase.com/2017/05/20/improved-tfs-version-control-tools/

    You could also read the code on the SysCompareForm for example, which pulls previous changesets for the code compare window specific for an object.

  • Community Member Profile Picture
    on at

    Hi,

    As i observed the code, and for getting the item history i have to pass controllable object , which is the nothing but a value as the path of the object.
    Fig:1- Passing the controllable object.              fig:2 Controllable object taking path as a value of type syscontrollable

    7457.Path.PNG 7457.Path.PNG

    so can it be possible that, i could just only passing the name of the object and it is filled the controllable object as path of the object from AOT. ? Please help me to achieve this.

    Regards,

    Pankaj Kumar

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    A SysVersionControllable object can be instantiated from a TreeNode AOT object, or path via the SysTreeNode class (casting works too with the AS keyword based on SysTreeNode):

    SysVersionControllable controllable = SysTreeNode::newTreeNodePath(treeNodeAOTpath);

    Based on this you could write your own method to get the controllable object by only passing in the AOT path.

    You need to know the entire path since based on the object name you would get multiple hits (check SysModelElement and *ElementData tables filtered by name like SalesTable for example, and see how many different element types you get).

  • Community Member Profile Picture
    on at

    Based on the above answer , I have written the below code, but it ends with error, Please verify and correct once, if needed.

    static void getingVersionId(Args _args)

    {

       SysVersionControllable      controllable, value;

       SysVersionControlTmpItem    item;

       SysDictClass                sysDictClass;

       sysDictClass = new SysDictClass(1059);

       if (sysDictClass.isImplementing(classnum(SysVersionControllable)))

       {

       controllable = SysTreeNode::newTreeNodePath("\Classes\TestingArgs");

       }

       if(controllable)

       {

           item = versionControl.getItemHistory(controllable);

           while select item order by Version

           {

           info(strFmt("Item: %1",item.Version));

           info(strFmt("Item: %1",item.ActionText));

           info(strFmt("Item: %1",item.ChangeNumber));

           }

       }

       item.setTmp();

       item.checkRecord(false);

       item.setTmpData(item);

    }

    Regards,

    Pankaj Kumar

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Share the error text and the call stack with the line number please. If you debug, do you see the objects instantiated correctly?

    I think the backslash is being converted as control characters/escape sequences in this case, and you are supposed to put it as literal string.

    https://en.wikipedia.org/wiki/Escape_sequences_in_C

    You can do it by putting an @ character in front of the quotation marks, or escape the backslash by doubling it up.

    @"\Classes\YourClass"
  • Verified answer
    Community Member Profile Picture
    on at

    This code worked..!

    ----------------------------------

    static void getingVersionId(Args _args)

    {

      SysVersionControllable      controllable, value;

      SysVersionControlTmpItem    item;

      controllable = SysTreeNode::newTreeNodePath(@"\Classes\PNG_MeltingReportDP");

      if(controllable)

      {

          item = versionControl.getItemHistory(controllable);

          while select item order by Version

          {

          info(strFmt("Item: %1",item.Version));

          info(strFmt("Item: %1",item.ActionText));

          info(strFmt("Item: %1",item.ChangeNumber));

          }

      }

      item.setTmp();

      item.checkRecord(false);

      item.setTmpData(item);

    }

    Thanks for correcting me, really appreciated !

    Regards,

    Pankaj Kumar

  • Vilmos Kintera Profile Picture
    46,149 on at

    Great work!

    Kindly mark the first post as well if it proved to be helpful, since I assume that has lead to finding out the correct solution. Thank you

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans