FIELDACTIVE Function (Record)
Checks whether a field is enabled.
Ok := Record.FIELDACTIVE(Field)
The record that contains the field to check.
The field that you want to check.
Property Value/Return Value
true if the field is enabled; otherwise, false.
Each field in a record can be set as enabled or disabled in the table description. You cannot use a disabled field because disabled fields cannot contain data.
This example requires that you create the following variable and text constants in the C/AL Globals window.
|Text constant name||ENU value|
|Text001||The field is not marked as enabled.|
CustomerRec."Address 2" := Text000; // If the Address 2 field has not been marked as enabled, then this // statement causes a run-time error. // You can avoid this error by performing the following test. IF CustomerRec.FIELDACTIVE("Address 2") THEN CustomerRec."Address 2" := Text000 ELSE MESSAGE(Text001);