Export (0) Print
Expand All

FIELDACTIVE Function (Record)

Microsoft Dynamics Nav 2009

Checks whether a field is enabled.


Ok := Record.FIELDACTIVE(Field)

Parameters

Field

Type: Field

The field that you want to check.

Type: Boolean

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.

Variable name DataType Subtype

CustomerRec

Record

Customer

Text constant name ENU value

Text000

Atlanta

Text001

The field is not marked as enabled.

CustomerRec."Address 2" := Text000;
// If the Address 2 field has not been marked as enbaled, 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);

Community Additions

ADD
Show:
© 2014 Microsoft