Saturday, April 30, 2011

Exporting Labels with .XPO's in Dynamics AX 2009

     As an AX developer, I have learned that there is (almost always) at least two ways to accomplish any task inside the Microsoft Dynamics AX Environment. I have had the opportunity to work with several consultant developers   and I was (and still am) surprised by the fact that none of them knew the procedure for importing and exporting .XPO files with labels. Instead what they do is provide you with either an XPO (if you are lucky, most times they send a layer even if they only changed one object) and a label file. You must then take the AOS offline so that you can copy the label files over and then restart the AOS. This can be a real hassle, especially if you are receiving these updates several times a day (it is even more annoying when you find out that they gave you an older label file and some labels are missing).
     I found this so surprising (and aggravating) that I decided to do a little Google research and what I learned was that there is no Good information out there about how to perform this procedure. So I am taking it upon myself to make this information available. You're welcome Internet:
     I set up a new test project and I created a new report and a new menu item for that report. I created a new label (@HLY739) for it:
Next, you must export the project:
Then you need to make sure that you check the box that says"Export Labels":
For my purposes, I have unselected all the languages and only selected English (United States). If you or your company uses additional languages you should check those here.Then click OK and you should get the export completed message in the compiler output window:
If that is successful, then you are ready to import the XPO into another environment:
Make sure that you have selected the radio button for application objects and labels (you can also do just the application objects or just the labels). If you select the show details check box and then click on the Labels tab, you can see all of the labels in the project an can even manually select weather or not you would like to import the label. 
Then for the last step, you can check and make sure that the label was imported correctly:

As you can see, the label has been successfully added to the new environment with absolutely no down time! 

2 comments:

  1. It is worth noting that during the import, if you do not check the "Show details" checkbox, all new labels which are imported get placed into the label file specified in "Create labels in the label file".

    I recommend always looking at details of the import, you would be surprised how often more, or less, of what you expect to be different actually is.

    Also, when reviewing the label tab, since there can potentially be many labels to review, sorting by the Action column, or filtering to exclude "Do not import label," is useful to since those can usually be safely ignore. Others should be checked to ensure they are as you expect. The "Import label" action indicates that the label will be brought in at the same label identifier as in the environment it was exported from. This is usually the desired result. But based on what labels already exist in the environment being imported into, it may decide to "Make a new label" or "Use an existing label." I often switch these to Import label in order to ensure that the import environment matches the export environment's labels as closely as possible.

    ReplyDelete
  2. It may be worth noting also, that if the corresponding label file (.ald) for the labels is set to read-only, AX will deceptively allow you to make changes to the labels, or import them through the client.

    This initially behaves correctly, until you shut down the AOS. Since the AOS was never able to save the changes to the label file, they are lost, and will be missing when the AOS comes back online.

    I have not noticed any error messages related to this. So it can be hard to realize what is happening when labels keep disappearing. The base AX layers (such as sys and syp), appear to be writeable, so these can be modified and saved. But be mindful if you receive label files from an outside source, they may not mention that they've set them read-only.

    ReplyDelete