Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AX7 Move specific elements from one model to another

(0) ShareShare
ReportReport
Posted on by 160

Hello,

Is there a "magic" way to move elements from a specific model to another?

(As in AX2012 the option move to model)

For exemple:

All my new specific EDT/Table from  MyModel to the ApplicationSuite model?

*This post is locked for comments

  • Suggested answer
    Joris dG Profile Picture
    17,775 on at
    RE: AX7 Move specific elements from one model to another

    When you move something from one package to another, you have to first compile the original package to get the code "out". Then compile the new package to get your code in that binary. If you setup the tools to synchronize when you compile this could result in data loss on your box. If you don't have that setup and do a sync after both packages are compiled - then there will be no data loss.

    Also when deploying to an existing environment this won't result in data loss if both removal from one package and addition to another are deployed together (since sync is done at the end of deploying all packages in the deployable package). And of course, it assumes the fields/tables have the same name still...

  • Community Member Profile Picture
    on at
    RE: AX7 Move specific elements from one model to another

    I'd say there generally shouldn't be data loss as long as table and fields keep the same names as before.

    I've moved fields from customised tables to their respective extensions and entire tables between models without data loss.

    I think the only crucial step apart from not changing names is to synchronise the db at the very end, not while you're still making changes.

  • Martin Dráb Profile Picture
    231,923 Most Valuable Professional on at
    RE: AX7 Move specific elements from one model to another

    I actually wouldn't expect data loss, although I'm not sure. Note that the file don't contain any ID at all; IDs for names are assigned on synchronization. And since the name doesn't change, AX can keep the ID the same.

    Simply test it to know for sure which theory is correct.

  • Jonathancm Profile Picture
    416 on at
    RE: AX7 Move specific elements from one model to another

    I think you are right. Probably the data will be deleted. I don´t know if we can modify those Id like we used to do it older "AX" versions in the Data Dictionary tables. Specially in migration scenarios, sometimes we had to "play" with those Ids for table and fields.

  • Zain Bokhari Profile Picture
    3,208 Moderator on at
    RE: AX7 Move specific elements from one model to another

    I think Data would be lost for that column, because field name would be same but field ID (fieldnum) would be different.

  • Jonathancm Profile Picture
    416 on at
    RE: AX7 Move specific elements from one model to another

    Hi Joris,

    One more question regarding this. I know is an old topic. If there's an over-layering modification, that adds a new field in a standard table. (This is in Production environment). Now we are working in a extensible solution in Development environment. Let's say we deleted the field from the overlayering model, and created a new one in a new model (because as you say we can't move the customization in that scenario). What will happen when we deploy the solution package into Sandbox? will the data be deleted from the field / even though the field still exists in the table but now in a different model?

  • Alex Kwitny Profile Picture
    395 on at
    RE: AX7 Move specific elements from one model to another

    Here's a Powershell snip you can modify that I used to move in VSTS to retain history.

    $tf = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\tf.exe"
    
    $source = "$/MyProject/Trunk/Main/Metadata/Directory/Directory.MySolution/AxTable/*"
    $target = "$/MyProject/Trunk/Main/Metadata/MySolution/MySolution/AxTable/"
    
    . $tf rename $source $target
    


  • Suggested answer
    PA-22040759-0 Profile Picture
    6,194 on at
    RE: AX7 Move specific elements from one model to another

    I'll just chip in with my notes on moving label files:

    • A label file consists of several files.
      Under \AxLabelFile there is an XML file for each language with some metadata about the label files.
      And then again under \LabelResources you'll find the actual label files for each language.
    • In the XML files with the metadata about the labels your need to modify the RelativeUriInModelStore property to reflect the new location.
    • You should move the above files from Visual Studio/VSTS, so you keep version history of earlier changes.
    • If you did an earlier build, you must manually remove the compiled dll's for earlier compiled label files. You'll find these in the Resources folder for the model you moved the files from. There is a dll directly in the folder, and one in the subfolder for each language. If you don't remove the dll's, AX might keep using the old and wrong version.  
  • Zain Bokhari Profile Picture
    3,208 Moderator on at
    RE: AX7 Move specific elements from one model to another

    Hi, Foxsor.

    If your question has been answered please mark the helpful answers as verified and mark this thread resolved. Thanks.

  • Alex Kwitny Profile Picture
    395 on at
    RE: AX7 Move specific elements from one model to another

    @Róbert, I would think you need to move in VSTS otherwise when you get latest, it will just put the files back, which could duplicate them in both models?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,245 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans