CURRENTKEY Function (RecordRef)

Returns the current key of the table referred to by the recordref. The current key is returned as a string.


CurrentKey := RecordRef.CURRENTKEY

Parameters

RecordRef

Type: RecordRef

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

Type: Text

The name of the current key of the record.

This example shows how to use the CURRENTKEY function.

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);
MESSAGE(Text000,RecRef.CAPTION,RecRef.CURRENTKEY)

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.

Community Additions

ADD
Show: