$fieldcheck

Return or set the requirement for field validation.

$fieldcheck { (Field) }

$fieldcheck { (Field) } =Expression

set | reset  $fieldcheck { (Field) }

Example:  set $fieldcheck(CUST_NUMBER.CUSTOMER)

Parameters

Parameters
Parameter Data Type Description
Field String Field name; optional. It can optionally contain a qualified field name, for example MYFLD.MYENT. If omitted, the current field is used.
Expression String When Expression evaluates to a non-zero value, $fieldcheck becomes 1.

Return Values

Values returned in $fieldcheck
Value Meaning
0 0, if field checking is not currently enabled.
1 1, if field checking is currently enabled.

When $fieldcheck is used as the target of an assignment, $status is set:

Values returned in $status

Value

Meaning

""

Field checking could not be enabled. This usually means that Field is not present, or does not exist.

1

Field checking was successfully enabled.

If an error occurs, $procerror contains a negative value that identifies the exact error.

Values of $procerror Commonly Returned Following Field-Level ProcScript Functions
Value  Error constant Meaning
-1101 <UPROCERR_FIELD> An incorrect field name was provided; either the field name is not valid syntactically or the field is not available in the component.

Use

Allowed in form and service components (and in report components that are not self-contained).

Description

$fieldcheck returns a value that indicates whether validation should be carried out for the Field the next time it occurs.

If $fieldcheck is set, validation is performed regardless of whether validation is actually required. (Validation is required when both $fieldmod and $fieldvalidation are 1, indicating that the field has been modified, but has not yet been validated).

Validation can occur when

  • An explicit validation statement is encountered (for example, validatefield);
  • A store statement is encountered.
  • The user leaves the field in a Form component;

When a field is validated, the syntax is checked, and the validate trigger is activated. In Form components, the loseFocus trigger is also activated.

After validation completes, $fieldcheck is set to 0.

Changing the Value of $fieldcheck

You can also use $fieldcheck as the target in the left side of an assignment. Set $fieldcheck to 1 to require syntax checks for the specified field; set it to 0 to let Uniface take responsibility for validation. For example:

$fieldcheck=!$fieldcheck

Since $fieldcheck is essentially a Boolean function, when Expression evaluates to a non-zero value, $fieldcheck becomes 1.

Related Topics