Editar

Compartir a través de


FieldRef.Type() Method

Version: Available or changed with runtime version 1.0.

Gets the data type of the field that is currently selected.

Syntax

Type :=   FieldRef.Type()

Note

This method can be invoked using property access syntax.

Parameters

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

Return Value

Type
 Type: FieldType

Example

The following example opens the Customer table as a RecordRef variable that is named CustomerRecref. The code loops through fields 1 to 5 and creates a FieldRef that is named MyFieldRef for each field that is selected. MyFieldRef.Type retrieves the data of each field and displays it in a message box.

var
    MyFieldRef: FieldRef;
    CustomerRecref: RecordRef;
    varType: Variant;
    Text000: Label 'Field %1 is a %2 data type.';
begin
    CustomerRecref.Open(Database::Customer);  
    for i := 1 to 5 do begin  
      MyFieldRef := CustomerRecref.Field(i);  
      Message(Text000, i, MyFieldRef.Type);  
    end;  
END;

FieldRef Data Type
Get Started with AL
Developing Extensions