FieldDefn Class Properties

In this section, the FieldDefn class properties are described in alphabetical order.

Description

Use this property to specify the number of digits after the decimal point to be displayed for a field defined as number or signed number. The valid values are 0 to 31.

This property is read/write.

Description

Use this property to specify the display of century in a field defined as date or date and time.

This property is read/write.

Description

Use this property to specify a description for a field.

This property is read/write.

Example

&myField.Description = "My new field";

Description

Use this property to specify the formatting of a field. It is valid for character (CHAR) field type.

You can use a value from the pre-defined format types. Value 5 with its associated constant value is deprecated, so it is not included in the list.

Numeric Value

Constant Value

0

%FormatFamilyType_Upper

1

%FormatFamilyType_Name

2

%FormatFamilyType_Phone

3

%FormatFamilyType_Zip

4

%FormatFamilyType_SSN

6

%FormatFamilyType_MixedCase

7

%FormatFamilyType_RawBinary

8

%FormatFamilyType_NumOnly

9

%FormatFamilyType_SIN

10

%FormatFamilyType_PhoneIntl

11

%FormatFamilyType_ZipIntl

Note: Custom format type is not supported.

This property is read/write.

Description

Use this property to specify the number of digits to be displayed for a field defined as number or signed number. The valid values are 0 to 31.

This property is read/write.

Description

Use this property to specify the length of the field of type character (CHAR). The valid values are 1 to 254.

This property is read/write.

Description

Use this property to specify the maximum length of a field. It is valid for long character (LONGCHAR) field type. Valid values are 0 to 32767.

This property is read/write.

Description

This property returns a multi-dimensional array of Any that contains the messages that occurred during execution of the Validate or Save methods. This array is only populated after the Validate or Save method has been executed.

The first dimension contains the message set number. The second dimension contains the message number. The third dimension contains the number of parameters in that message. The subsequent dimensions contain the values for the parameters. The maximum number of possible dimensions is 8.

This property is read-only.

Example

If Not &fieldDefn.Validate() Then
   Local array of array of any &msgs = &fieldDefn.Messages;
   &default_msg_txt = "";
   &message_set = &msgs [1][1];
   &message_nbr = &msgs [1][2];
   &numParams = &msgs [1][3];
   Evaluate &numParams
   When 0
      &errString = MsgGetText(&message_set, &message_nbr, &default_msg_txt);
   When 1
      &errString = MsgGetText(&message_set, &message_nbr, &default_msg_txt, &msgs [&index][4]);
   When 2
      &errString = MsgGetText(&message_set, &message_nbr, &default_msg_txt, &msgs [&index][4], &msgs [&index][5]);
   When 3
      &errString = MsgGetText(&message_set, &message_nbr, &default_msg_txt, &msgs [&index][4], &msgs [&index][5], &msgs [&index][6]);
   When 4
      &errString = MsgGetText(&message_set, &message_nbr, &default_msg_txt, &msgs [&index][4], &msgs [&index][5], &msgs [&index][6], &msgs [&index][7]);
   When 5
      &errString = MsgGetText(&message_set, &message_nbr, &default_msg_txt, &msgs [&index][4], &msgs [&index][5], &msgs [&index][6], &msgs [&index][7], &msgs [&index][8]);
   When-Other
      &errString = "Too many parameters - not supported"
   End-Evaluate;
   /* do something with &errString */
End-If;

Description

Use this property to specify the name of a field as a string value. Changing the name of a field and then saving it is equivalent to the rename operation. All references to the field by other managed objects will be updated as well.

This property is read/write.

Example

&myField.Name = "MYFIELD";

Description

Use this property to specify a translate value from the OBJECTOWNERID field as a string value.

This property is read/write.

Description

Use this property to set or return a Boolean value representing true (on) or false (off). It is valid for long character (LONGCHAR) field type.

This property is read/write.

Description

Use this property to determine whether this field definition was created using the FieldDefn class or not.

This property is read-only.

Description

Use this property to specify the format in which time should be displayed in a field defined as time or date and time.

You can use the following values:

Numeric Value

Constant Value

0

%TimeFormat_HHMI

1

%TimeFormat_HHMISS

2

%TimeFormat_HHMISS999999

This property is read/write.

Example

 &myField.TimeFormat = %TimeFormat_HHMI;

Description

Use this property to set the type for a field. The values can be one of the following:

Numeric Value

Constant Value

0

%FieldType_Char

1

%FieldType_LongChar

2

%FieldType_Number

3

%FieldType_SignedNumber

4

%FieldType_Date

5

%FieldType_Time

6

%FieldType_DateTime

The following field types are not supported:

  • Attachment

  • Image

  • Image Reference

This property is read/write.

Example

 &myField.Type = %FieldType_Char;