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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AX 2012 and TFS Version control - Shelvesets

(0) ShareShare
ReportReport
Posted on by

TFS allows to shelve and unshelve the changes for the team project. Is this feature supported with AX 2012?

It looks like unshelving only works for xpo that is in TFS and local repository but AX AOT doesn't get updated with the unshelved changes. If this is supported, are there steps to refresh AOT with the unshelved changes? 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Joris dG Profile Picture
    17,775 on at

    There is no out of the box support inside AX for shelving/unshelving.

    For shelving, AX saves the XPO to the local repository anytime the object is compiled (which typically is anytime you save). So shelving can be done from Visual Studio on that workspace.

    Unshelving is a different story. You would technically have to unshelve in Visual Studio, then import each XPO that was unshelved into AX.

  • Community Member Profile Picture
    on at

    Thank you Joris.

    That seems to work ok for most of the cases. The only issue I am getting is when the change in the shelveset  is related to event handlers. Getting this warning when trying to import unshelved xpo:

    No tree node for ...Data Dictionary\Tables\CustTable.xpo

    The only change in the xpo is added event handler. Any ideas on this would be much appreciated.

  • Joris dG Profile Picture
    17,775 on at

    Is the event handler on a method that perhaps doesn't exist on your table? That's all I can think of.

    Also, some people do share a VM for development. Doing unshelving in a shared AOS environment is not a good idea - should add that as a disclaimer :-)

  • Community Member Profile Picture
    on at

    Joris, I have tried to do the same on standard object just to make sure there are no issues with non-existent methods. All this is in local DEV environment but really appreciate you mention about the shared environment and unshelving compatibility, very useful and should be a disclaimer indeed ))

    I have done a bit more testing on this and I think the issue is with AX not supporting Compare function for xpo exported from a layer for event handlers specifically. So this kind of xpo have to go straight in without using Compare tool to check mods ((

    Steps to repro:

    1. Add event handler to a table method (all standard AX objects)

    2. Export for specific layer the change is in. This is what TFS does as well, only saving xpo change in a specific layer.

    3. Delete the changes done in step 1

    4. Select the xpo from step 2 for import. Use show details check box and try to compare object  - this  gives 'No tree node for...'  error.

    I suppose the event handlers should be transferred through models rather than xpos but have doubts on how well it would work with unshelving in TFS.

    So, overall conclusion I get to is not to use shelve sets with AX code when event handlers are involved.

  • Martin Dráb Profile Picture
    237,807 Most Valuable Professional on at

    This has nothing to do with TFS - you're talking about a general problem with code comparison. I suggest you fill a bug with Microsoft, if it doesn't exist already.

    Nevertheless note that I wasn't able to reproduce the problem using your instructions (in AX 2012 R2 CU7).

  • Martin Dráb Profile Picture
    237,807 Most Valuable Professional on at

    Look at KB 2887841 (Error during xpo-import class with event handler), released on 9/9/2013. It might be the solution.

  • Community Member Profile Picture
    on at

    Martin, gree this has nothing to do with TFS))  I was just trying the work around that was suggested for using unshelving from TFS and getting that code back into AX when I run into the issue. So, wanted to note that not all objects can be imported back into AX because TFS is doing export from layer for repository.

    Sorry, should have mentioned that I am testing in 2012 R3 (Application/Kernel 6.3.1000.309). But this should include the fixes from R2 CU7 I suppose unless  new issue for R3.

    That you for trying to reproduce the issue. Do I understand correctly that you can see the diff for event handle in Compare tool for the object you are trying to import?

    I am trying on a table, thought I add a code here just to make sure there is nothing else I haven't noticed (...and in case you get the time to check this :)

    Exportfile for AOT version 1.0 or later

    Formatversion: 1

    ***Element: DBT

    ; Microsoft Dynamics AX Table : AssetTable unloaded

    ; --------------------------------------------------------------------------------

     TABLEVERSION 1

     TABLE #AssetTable

       EnforceFKRelation 0

       FIELDS

       ENDFIELDS

       GROUPS

       ENDGROUPS

       INDICES

       ENDINDICES

       FULLTEXTINDICES

       ENDFULLTEXTINDICES

       REFERENCES

       ENDREFERENCES

       METHODS

       ENDMETHODS

       EVENTS

         METHOD #validateFieldValue

           EVENTHANDLERS

             EVENTHANDLER #postValidateField_BR

               PROPERTIES

                 Class               #AssetTableEventHandler_BR

                 Method              #postValidateFieldHandler_BR

                 AOTlink             #\Classes\AssetTableEventHandler_BR\postValidateFieldHandler_BR

               ENDPROPERTIES

             ENDEVENTHANDLER

           ENDEVENTHANDLERS

         ENDMETHOD

       ENDEVENTS

     ENDTABLE

    ***Element: END

  • Community Member Profile Picture
    on at

    Will have a look into KB 2887841, thank you.  Sounds like it might be what is missing but again would assume it should already be in for R3

  • Martin Dráb Profile Picture
    237,807 Most Valuable Professional on at

    I was talking about your steps for getting "No tree node for..." error - I don't get anything like that.

    I indeed don't see the change in the compare window (if the .xpo contains just one layer), which is incorrect, but it doesn't have any impact on import.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans