How to: Create and Use Labels
Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
You should use labels to specify the user interface text for forms and reports. Labels are created in the Label Editor, and then used in text-based properties in the Application Object Tree (AOT) or in X++ code.
The Label property determines the name of a report or form. It can be set on table fields, extended data types, or a report or form in the AOT. It is recommended that you set the property on an extended data type so the label is inherited by any object that references the extended data type.
To create a new label, you must create or update a label file. For more information, see How to: Create a Label File.
A label can be up to 2000 characters long. For guidelines on the content of labels, see Best Practices for Labels and HelpText Guidelines.
Procedures
Adding a new label
New labels are added in the Label Editor. If you are using version control, you will have to check out the label file before you add a new label. For more information, see Label Editor.
To add a label using the Label Editor
Click Tools > Label > Label editor.
Type the string you want to use for the label in the Find what box, and then click Find now.
If a label containing the text already exists, check whether you can reuse this label or whether you should create a new semantic instance.
Look at the Description field so see whether there are any notes about the use of the label.
Click the Used by button to see where the label is already used in the application.
To create a new label, press CTRL+S to save the text in the Find what box as a new label.
Your new label will be allocated a label ID. Use this to refer to the label in code or in the property window for an item in the AOT.
Add a comment in the Description field to describe the semantic use of your new label. You should also use this field to add notes that may be helpful to translators.
Save your changes.
Using labels
To use a label in the property sheet in the AOT
In the AOT, right-click the object you want to define a label for, and then click Properties.
Type the string you want to use in the Label property.
Click the Label icon to open the Label Editor, and then click Find now to search for the text in the existing label files.
Select the label from the search results, and then click Paste label.
To use a label in X++ code
- Click the Insert label icon in the X++ editor.
See also
Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.