Tuesday, November 1, 2011

Creating a new label file in AX

We will use the Label file wizard available in AX to create the new label file. Open the Dynamics AX client and then navigate to Microsoft Dynamics AX / Tools / Development tools / Label / Label file Wizard.
On the Label file Wizard’s Add label file step, check the Create new label file ID checkbox. In AX, there are in-built label ids like sys, gls that are named after the layers. However, for the Flight Stats application, I would like to create a label id of my own. That’s the reason I would like to create a new label id. I don’t want to create a new language. So, I will leave the Create new label language unchecked. Click Next.
On the Label file Wizard’s New label file id step, enter the value FLS in the label file ID. This is the label id that would denote the FLight Stats application labels. Also, read the note on this wizard about the abbreviations that cannot be used as label id because those ids are reserved for AX. Click Next.
On the Label file Wizard’s Create the label files step, click Finish.
Now, let’s go to the application files folder to see what files were created. In my case, the application files are installed in the path E:\Program Files\Microsoft Dynamics AX\50\Application\Appl\DEVDAX50Base. In the folder, search for axFLS*.ald and you will see 41 files created one for each of the 41 languages currently supported by Dynamics AX 2009. Label files are named as mentioned below:
  1. ax is the prefix used by the application files.
  2. FLS stands for the label file id that we provided in the wizard.
  3. Label id is then followed by language culture codes like en-us, en-gb, es or fr-ca and so on.
  4. The label files have the extension .ald It stands for Application Label Data.
The label files can be opened and viewed in a text editor. Let’s see what is inside the newly created label file in language en-us. Since the extension .ald will not be recognized by Windows, we need to first associated it with a program to open the file. Right-click on the axFLSen-us.ald file and select Open.
On the dialog that is prompts you with What do you want to do? message, check the option Select a program from a list of installed programs. Click OK.
On the Open with dialog, if you see the Notepad under Recommended Programs then select it. If you don’t see any programs under Recommended Programs, click on the expand icon and then you should see the Notepad program. In future, if you would always like to open the label files in Notepad then select the option Always use the selected program to open this kind of file. Click OK.
The label file will now be opened in the Notepad. There are four parts to this label file.
  1. The language of the label file. Here in this case, we have opened the file axFLSen-us.ald. That means we are viewing only label contents in en-us language (English – United States). So, each language translation is stored in a file of its own.
  2. @FLS0 denotes the label id. It uses auto incremental value. So, the next labels will have the ids @FLS1, @FLS2 and so on.
  3. The label id is then followed by a space and then the label text. Here in this case the label text Label files created on 4/9/2011 is auto generated by AX.
  4. On the next line, the text By user Siva denotes the description about the label. This gives an additional information about the usage of the label but it is not part of the text. Also this is optional.
So, we have a new label file. Let’s create a new label manually. Go back to the Dynamics AX client and then navigate to Microsoft Dynamics AX / Tools / Development tools / Label / Label editor.
Let’s first search for the existing label. We have only one existing label at this moment, which is @FLS0. Enter the text @FLS0 in the Find what textbox and click Find now or press Enter. Label editor will list the matching label. You can also see 4 columns namely Label ID, Language, Label and Description. These are the four parts that we discussed earlier.
Click on the Setup tab and you will notice that the Label file ID dropdown is pre-selected to FLS because that is the only custom label id currently available. You will also see 40 other languages listed in the bottom section. Including English – United States, there are 41 languages. The default language will not be listed in this section. The default language is the own that is shown in the In the language dropdown on the Label tab. Here in this case, the default selected language is en-us.
Here is the list of all the 40 languages.
Now, let’s create a new label. To create a new label, switch to the Label tab. Click on the New icon or press Ctrl + N. You should see a new row with just language column pre-populated with the default language (here in this case en-us)
Under the column Label, enter the text Flight Stats. I am going to ignore the Description column.
Click Save icon or press Ctrl + S. You should now see the label id @FLS1 assigned to the new label text.
Let’s make a minor change to the label by changing the upper case S to lower case s. I am doing this to showcase another feature related to the labels. Click Save icon or press Ctrl + S to save the changes.
There is another feature called Label log. As the name suggests, this captures the changes made to the labels. You can click on the Label log button that appears on the Label editor for a given label or you can navigate to Microsoft Dynamics AX / Tools / Development tools / Label / Label log.
Label log will show all the label changes that have occurred. It could Inserted, Modified or Deleted. Here in the screenshot, you can see that I created label id @FLS1 and also modified it. Also, I created another label id @FLS2 and deleted it.  This will help in keeping tracking of the labels that you think have suddenly disappeared!
Now, I have created a new label file for Flight Stats application. In the next post, I will discuss about creating new objects.

No comments:

Post a Comment