CURRENTKEY Function (RecordRef)

Gets the current key of the table referred to by the RecordRef. The current key is returned as a string.


CurrentKey := RecordRef.CURRENTKEY  


Type: RecordRef

The RecordRef that refers to the table for which you want to identify the current key.

Property Value/Return Value

Type: Text

The name of the current key of the record.


This example requires that you create the following text constants and variables in the C/AL Globals window.

Text constant ENU value
Text000 The current key in the "%1" table is "%2".
Variable Data type
RecRef RecordRef

RecRef.Open(18) - Opens table 18 or causes a run-time error if table 18 does not exist.

RecRef.Caption - Returns the caption of the table.

RecRef.CURRENTKEY - Returns the caption of the current key in the table.

See Also

RecordRef Data Type