Gets the RecordRef of the field that is currently selected.
This function returns an error if no field is selected.
RecordRef := FieldRef.RECORD
- Type: FieldRef Refers to the current field.
The RecordRef of the field that is currently selected.
See also RecordRef Data Type.
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 function 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. This example requires that you create the following variables and text constant in the C/AL Globals windows.
|Text constant||ENU value|
The selected field is from table %1.
ItemRecref.OPEN(DATABASE::Item); MyFieldRef := ItemRecref.FIELD(1); MyRecRef := MyFieldRef.RECORD; MESSAGE(Text000, MyRecRef.NUMBER);