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;

FieldRef Data Type
Get Started with AL
Developing Extensions