Share via


ACTIVE Function (KeyRef)

Indicates whether the key is enabled.

Ok := KeyRef.ACTIVE

Parameters

  • KeyRef
    Type: KeyRef The keyref that refers to a key.

Property Value/Return Value

Type: Boolean

true if the key is enabled; otherwise, false.

Example

The following example uses the KeyRef.ACTIVE function to determine whether a key in a record is enabled. The table with ID 18 (the Customer table) is open with a reference to table 18. The KEYINDEX Function (RecordRef) function retrieves the first key in the record and the varKeyRef.ACTIVE function returns a Boolean value that indicates whether the retrieved key is enabled. The Boolean value is displayed in a message box. This example requires that you create the following variables in the C/AL Globals window.

Variable name DataType

RecRef

RecordRef

varKeyRef

KeyRef

IsActive

Boolean

RecRef.OPEN(18);
varKeyRef := RecRef.KEYINDEX(1);
IsActive := varKeyRef.ACTIVE;
MESSAGE('Is the key active =  %1 ', IsActive);

See Also

Reference

KeyRef Data Type