# FieldRef.Caption() Method
> Version: _Available or changed with runtime version 1.0._
Gets the current caption of a field as a String.
## Syntax
```al
Caption :=   FieldRef.Caption()
```
> NOTE
> This method can be invoked using property access syntax.
## Parameters
FieldRef
Type: fieldref-data-type
An instance of the fieldref-data-type data type.
## Return Value
Caption
Type: ../text/text-data-type
## Remarks
The Caption method returns the caption of a field. Caption first looks for a ../../properties/devenv-captionml-property. If it does not find one, it will use the Name Property<../../properties/devenv-properties>. This means that Caption is enabled for multilanguage functionality.
This method is similar to the ../record/record-fieldcaption-method.
## Example
The following example opens table 18 \(Customer\) as a RecordRef variable that is named CustomerRecref. The code uses the ../recordref/recordref-field-method to loop through field 1 through 9 and creates a FieldRef variable that is named MyFieldRef. For each field, the Caption method retrieves the caption of the field, stores it in the varCaption variable and displays it in a message box.
```al
var
    MyFieldRef: FieldRef;
    CustomerRecref: RecordRef;
    varCaption: Text;
    i: Integer;
    Text000: Label 'The caption for field %1 is "%2"';
begin
    CustomerRecref.Open(18);
    for i := 1 to 9 do begin
      MyFieldRef := CustomerRecRef.Field(i);
      varCaption := MyFieldRef.Caption;
      Message(Text000, i, varCaption);
    end;
    CustomerRecref.Close;
end;
```
## Related information
fieldref-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

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/methods-auto/fieldref/fieldref-caption-method, 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/methods-auto/fieldref/fieldref-caption-method/
