RecordRef.RecordId() Method
Version: Available or changed with runtime version 1.0.
Gets the RecordID of the record that is currently selected in the table. If no table is selected, an error is generated.
Syntax
RecordID := RecordRef.RecordId()
Note
This method can be invoked using property access syntax.
Parameters
RecordRef
Type: RecordRef
An instance of the RecordRef data type.
Return Value
RecordID
Type: RecordId
The ID of the table.
Example
The following example opens table 18 (Customer) as a RecordRef variable that is named MyRecordRef. The FindLast Method (RecordRef) finds the last record in the table. The record id of the last record is retrieved, stored in the RecID variable displayed in message box.
var
MyRecordRef: RecordRef;
RecID: RecordId;
Text000: Label 'The record id for the last record is: %1';
begin
MyRecordRef.Open(18);
MyRecordRef.FindLast;
RecID := MyRecordRef.RecordId;
Message(Text000, RecID);
end;
Related information
RecordRef Data Type
Get Started with AL
Developing Extensions