Skip to content

Latest commit

 

History

History
57 lines (46 loc) · 1.88 KB

fieldref-getenumvaluenamefromordinalvalue-method.md

File metadata and controls

57 lines (46 loc) · 1.88 KB
title description ms.author ms.date ms.tgt_pltfrm ms.topic author
FieldRef.GetEnumValueNameFromOrdinalValue(Integer) Method
Gets an Enum value (or Option member) name from the Enum metadata for the field that is currently selected.
solsen
02/26/2024
na
reference
SusanneWindfeldPedersen

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

The Enum value name or empty if the ordinal value doesn't exist :=   FieldRef.GetEnumValueNameFromOrdinalValue(Ordinal: Integer)

Parameters

FieldRef
 Type: FieldRef
An instance of the FieldRef data type.

Ordinal
 Type: Integer
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
The Enum value name.

Example

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;

See Also

FieldRef Data Type
Get Started with AL
Developing Extensions