Gets the number of keys that exist in the table that is referred to by the RecordRef. Returns an error if no table is selected.
Count := RecordRef.KEYCOUNT
- Type: RecordRef The RecordRef that identifies the record and the table in which you are interested.
Property Value/Return Value
The number of keys that have been identified in the table.
The following example opens the Customer table (18) as a RecordRef variable that is named CustomerRecref. The KEYCOUNT function retrieves the number of keys that are defined in the Customer table. The return value of the function is stored in the KeyCount variable and displayed in a message box. The KeyCount variable contains the number 13 because 13 keys are defined in the Customer table. This example requires that you create the following variables and text constant in the C/AL Globals window.
|Text constant||ENU value|
The table has %1 keys.
CustomerRecref.OPEN(18); KeyCount := CustomerRecref.KEYCOUNT; MESSAGE(Text000, KeyCount);