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.
Property Value/Return Value
You can show strings that include RECORDID in the user interface by using the FORMAT Function (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 Function (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. This example requires that you create the following variables and text constant in the C/AL Globals window.
|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);