# Working with labels
> NOTE
> We're working to improve the onboarding experience for AL developers. If you have feedback about this article, use the Feedback section at the bottom of the article to tell us what you'd like to see.
> We also welcome contributions to our documentation. Learn more about contributing in Contribute to the help<../help/contributor-guide#contributing>.
Labels are string constants displayed in the Business Central client that can be translated into multiple languages, such as captions, descriptions, or messages. This way, the user interface can be displayed in different languages.
Learn more about how translation works in Business Central in Multilanguage development<devenv-work-with-translation-files>.
## Label syntax
Labels use a specific syntax that's defined by a text constant followed by three optional parameters. You must separate the parameters with commas, but the order isn't enforced. You can set the Comment, Locked, and MaxLength parameters, which are described in the following table.
Parameter|Type|Description
Comment|Text|Used for general comments about the label, specifically about the placeholders in that label.
Locked|Boolean|When Locked is set to true, the label shouldn't be translated. The default value is false.
MaxLength|Integer|Determines how long the label can be. If no maximum length is specified, the string can be any length.
## Using labels
You can define a label in four different AL structures. A label can be:
 The property value of certain page and report properties
 The label data type variable
 A report label
 A page label
The following sections explain each option in more detail.
### Property value
The label syntax is used in properties that are set to display text on the user interface. You can use the label syntax for the following properties:
 properties/devenv-caption-property
 properties/devenv-tooltip-property
 properties/devenv-optioncaption-property
 properties/devenv-additionalsearchterms-property
 properties/devenv-instructionaltext-property
 properties/devenv-promotedactioncategories-property
 properties/devenv-requestfilterheading-property
The following example shows the label syntax when you use it as the property value for the Caption property. The syntax is similar for the other properties in the list.
```al
Caption = 'Developer translation for %1', Comment = '%1 is extension name', Locked = false, MaxLength = 999;
```
### Label data type
The methods-auto/label/label-data-type denotes a string variable used to define error messages, questions, captions, tokens, or other text constants displayed to the user.
The following code sample illustrates how to use the Label data type. The Comment, MaxLength, and Locked parameters are optional, but they can be used to provide additional information about the label. See #label-syntax. In the following example the label text is locked for translation and has a maximum length of 999 characters.
```al
var
    MyLabelTxt: Label 'Label Text', Comment = 'This label shouldn''t be translated.', MaxLength = 999, Locked = true;
```
> TIP
> With Business Central 2023 release wave 2, you can hover over any variable of the Label data type to see the text string value of the label.
There's a guideline for naming Label variables. Label variable names should have an approved suffix, such as Txt. See CodeCop rule AA0074<analyzers/codecop-aa0074>.
### Report labels
Report labels are used by report layouts as, for example, the caption for a field, the title for a chart, or the title for the report itself.
Learn more about labels on reports in devenv-report-object#report-labels.
### Page labels
Page labels are used to display plain text on a page, such as instructions or informative texts. You can find several examples of page labels in the RapidStart Services Wizard in page `"Config. Wizard"`.
Page labels are defined by a `label(Name)` control inside the `area(Content)` part of a page. The following code shows how to define a page label.
```al
label(BeforeSetupCloseMessage)
{
    ApplicationArea = Basic, Suite;
    Caption = 'If you still need to change setup data, don''t change the profile.'
}
```
## Related information
devenv-work-with-translation-files
methods-auto/label/label-data-type
devenv-report-design-overview#report-layouts

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-using-labels, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-using-labels/
