RecordId Method (Record)
Gets the RecordId of the record that is currently selected in the table. If no table is selected, an error is generated.
RecordId := Record.RecordId;
The record whose RecordId you want to get.
You can show strings that include RecordId in the user interface by using the Format Method (Code, Text). In most cases, use the standard format value 1, which ensures that captions are shown in the current language. The following table illustrates the effect of the different standard formats when RecordId is used in a Format statement in a Danish locale.
|Standard Format||Renders as|
When you use standard format 1, the caption of the record is returned. When you use other standard formats, the name of the record is returned, which is usually English (US). For more information, see Format Property.
The following example opens table 18 (Customer) as a Record variable that is named MyRecord. The FindLast Method (Record) 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.
|Text constant name||DataType||ENU value|
|MyTextConst||Text||The record ID for the last record is: %1|
MyRecord.FindLast; RecID := MyRecord.RecordId; MESSAGE(MyTextConst, RecID);