# FieldRef.GetEnumValueNameFromOrdinalValue(Integer) Method
> Version: _Available or changed with runtime version 4.0._
Gets an Enum value (or Option member) name from the Enum metadata for the field that is currently selected.
## Syntax
```al
The Enum value name or empty if the ordinal value doesn't exist :=   FieldRef.GetEnumValueNameFromOrdinalValue(Ordinal: Integer)
```
## Parameters
FieldRef
Type: fieldref-data-type
An instance of the fieldref-data-type data type.
Ordinal
Type: ../integer/integer-data-type
The Enum value's ordinal value to get the Enum value (or Option member) name for.
## Return Value
The Enum value name or empty if the ordinal value doesn't exist
Type: ../text/text-data-type
The Enum value name.
## Example
```al
procedure OptionNoExists(var FieldRef: FieldRef; OptionValue: Text): Boolean
    var
        OptionNo: Integer;
    begin
        if Evaluate(OptionNo, OptionValue) then
            exit((FieldRef.GetEnumValueNameFromOrdinalValue(OptionNo) <> '') or ((FieldRef.GetEnumValueNameFromOrdinalValue(OptionNo) = '') and (OptionNo = 0)));

        exit(false);
    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-getenumvaluenamefromordinalvalue-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-getenumvaluenamefromordinalvalue-method/
