Value property: Field class

Description

This property contains the current value of the field, converted to an appropriate PeopleCode data type.

In most contexts, the Value property can be used to assign a new value to the field. However, there are some restrictions:

  • You cannot assign the Value property in any RowSelect PeopleCode program.

  • You cannot assign the current record field value to the Value property in any FieldEdit PeopleCode program.

Note:

If you’re accessing a field based on the translate table, Value returns only the one letter XLAT value. To get the full XLAT value, use the LongTranslateValue or ShortTranslateValue properties.

This property is read/write.

Example

&CHARACTER.Value = "Hello";

Considerations Using INSTALLATION or OPTIONS Tables

When using the INSTALLATION or OPTIONS table, you cannot use the Value property. You must use the old style format, not the field object format. For example, the following code is invalid:

If %Page = Page.GP_RUN_TYPE And
      INSTALLATION.TL.Value = "N" Then
   &RS2.HideAllRows();

While the following code is valid:

If %Page = Page.GP_RUN_TYPE And
      INSTALLATION.TL = "N" Then
   &RS2.HideAllRows();

Considerations Using Character Values

Previously, if you had an edit-box field, and if the end-user selected the value in it and deleted the value, leaving the field empty, the value of the field in PeopleCode was not an empty (zero-length) string.

Now, the value of such a field is an empty (zero-length) string.

In addition, if the user adds one or more space characters to a field, the field still returns a Null string.

The following is how to check for this:

If (fieldname.Value = "") Then