GETRECORD Function (RecordID)
Gets a RecordRef that refers to the record identified by the RecordID.
RecordRef := RecordID.GETRECORD
The RecordID of the record for which you want the RecordRef.
Property Value/Return Value
The RecordRef of the record.
No data is read from the database when you run this function and therefore, no other fields in the record are set. Furthermore, no filters are set on the record.
The following example opens table number 18 (Customer table) and sets a reference to the table. The FINDLAST Function (RecordRef) selects the last record in the table. The RECORDID Function (RecordRef) retrieves the ID of the currently selected record. In this case, it is the last record in the table. The GETRECORD Function (RECORDID) uses the retrieved record ID to determine the RecordRef of the selected record (the last record). This example requires that you create the following variables and text constant in the C/AL Globals window.
RecRef.OPEN(18); RecRef.FINDLAST; RecID := RecRef.RECORDID; RecRef := RecID.GETRECORD;