reconnect

Reconnect data loaded from a disconnected record set (XML, JSON, or Struct) with the occurrences in a component and database (if connected).

reconnect {/readcheck}  {EntityName}

Example: reconnect

Qualifiers

Qualifiers
Qualifier Description
/readcheck For read-only fields, ignores any user modifications and restores the field value from database.

Parameters

Parameters
Parameter Data Type Description
EntityName String Name of a component entity

Return Values

Values returned in $status
Value

Meaning

0 Occurrence was successfully reconnected.
>0 Number of errors encountered.

In this context, an error is defined as the number of times an error trigger returned a negative value.

Use

Allowed in all component types.

Description

Used after the xmlload, webload, or structToComponent statements, the reconnect command resolves the modification state information stored in the occurrence metadata. The procedure followed for each occurrence depends on the value of the occurrence modification state. For more information, see Occurrence Metadata for Reconnect and Reconnect Process.

The reconnect statement merges all disconnected occurrences that have a modification state other than "est". Occurrences that have the state "est" are not be reconnected. This improves performance and avoids CRC errors on occurrences that were not modified in this session anyway.

The ID property is used to merge disconnected occurrences with connected occurrences. Duplicate key checks are not done by reconnect. CRC checks are done for every merged occurrence.

Depending on the value of the status property, as set in $occstatus, Uniface modification flags are set or reset.

Effect of Occurrence Modification State on Uniface Modification Flags
$occstatus $occmod $storetype $occdel Description
"" 1 1 0 Treated as a new occurrence
"new" 1 1 0 New occurrence
"est" 0 0 0 Existing unmodified occurrence
"mod" 1 0 0 Existing modified occurrence
"del" X X 1 Marked as deleted occurrence

The Uniface modification flags of all fields in an occurrence get the same modification state. All modified occurrences and fields are flagged for validation ($occvalidation, $fieldvalidation, and so on). These flags can be reset in ProcScript. $formmod and $instancemod are recalculated. If no occurrences or fields have set modification flags, $formmod and $instancemod are reset again. All modified occurrences are locked in the database if the locking type is cautious.

For more information, see Reconnect Process.

Reconnecting Read-Only Fields

Fields are marked as read-only if:

  • The field syntax definition specifies NED (no edit allowed)
  • The field syntax has been changed to NED at runtime by the fieldsyntax or $fieldsyntax ProcScript instructions.

When the /readcheck switch is used in a reconnect process, any modifications made by the user to a read-only field are ignored and the field value is restored from the database.

History
Version Change
9.4.01 Introduced

Related Topics