Editar

Compartir a través de


FieldRef.Record() Method

Version: Available or changed with runtime version 1.0.

Gets the RecordRef of the field that is currently selected. This method returns an error if no field is selected.

Syntax

Record :=   FieldRef.Record()

Parameters

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

Return Value

Record
 Type: RecordRef

Example

The following example opens the Item table as a RecordRef variable that is named ItemRecref, creates a reference to field 1 (No.), and stores the value in the variable named MyFieldRef. The Record method uses the MyFieldRef variable to return the RecordRef of field 1 and stores the reference in a variable named MyRecRef. MyRecRef.Number returns the table that the selected field belongs to.

var
    MyFieldRef: FieldRef;
    ItemRecref: RecordRef;
    MyRecRef: RecordRef;
    Text000: Label 'The selected field is from table %1.';
begin
    ItemRecref.Open(Database::Item);  
    MyFieldRef := ItemRecref.Field(1);  
    MyRecRef := MyFieldRef.Record;  
    Message(Text000, MyRecRef.Number);  
end;

FieldRef Data Type
Get Started with AL
Developing Extensions