By now, you all must be aware that we are done with AOD files in Dynamics AX 2012. Model is the new deployment option for deploying AX objects on various installations. If you want to learn more about models, MFP has an excellent three part series on it which you can read here.
In this post we will look at how label files are contained within models in Dynamics AX 2012.
We now have a new node in AOT – Label Files
All labels in the system are grouped under this node.
Now suppose we have a label from another installation which we want to bring in to our system. Right click on the Label Files node and select Create from File. Browse and selct your .ald file. Once you select the file and hit OK, a new node is added under the Label Files node corresponding to the label file imported. You will get an info message saying “Imported label file:C:UsersAdministratorDesktopMyLabelen-us.ald”
In AX 2009, after placing a label file, we needed to restart the AOS so that the label index was build. This isn’t required in Dynamics AX 2012. Just try using the label somewhere, and you will see that it is immediately referenced.
If you search in your application folder, you wont find the label file there. The application folder is located here C:Program FilesMicrosoft Dynamics AX60ServerMicrosoftDynamicsAXbinApplicationApplStandard
In Dynamics AX 2012, the label file is imported in your current model.
Now let us restart the AOS and see what happens. After restarting the AOS, go back to your application folder and try to find the label file again. This time the label file will be found.
Point to remember, on every AOS restart, all label files will be copied to the application folder from the model store. So your label files are contained in your models but they are stored in your application folder as well.
Now let us try to delete the label file. Right click on your label file. Do you see a delete/remove option?
The answer is no. So how do we delete the label file then? The solution which I figured out was,
To create a temporary model
Move our label file to the temporary model
Stop the AOS
Delete the temporary model
Start the AOS
Let us get about with these tasks
Go to Tools -> Model management -> Create model
Enter name as TemporaryModel. Press OK. You will recieve an info message saying “The model TemporaryModel was created successfully in layer var.”
Right click on your label file and select “Move to model”
Select the TemporaryModel checkbox and press OK.
Stop the AOS.
Open a command prompt. We will be using the command line utility AXUTIL to delete the model.
Issue the following command in the command promptAXUTIL delete /model:TemporaryModel
You will be prompted if you want to delete the model or not. Press Y
Start the AOS
Delete the label file from your application folder as well.
When you open AX now, you will get a dialog saying that “Your model store has been modified.” This is normal because each time you perform an operation on a model, you will get this dialog. Depending on your operation, you should select one of the option. Since we just deleted a model which just had a label file, select Skip.
Open AOT and notice that the label file is deleted now.
Check if the references of the label work. I bet they wont be.
In this post we learnt how label files are managed in Dynamics AX 2012, how to import a label file and how to delete them.