Data Access

Determines the degree to which data in the component can be edited and stored.

Value Description
N (Full Read-Write Access ) Normal. The component can read and write data in the database. The read, lock, write, and validation triggers are executed. This is the default.
L (Read-Only) Limited. The component can retrieve data, but cannot store modified data. The lock, write, and validation triggers are never executed.
R (Record Form) Only applicable for Form components. The Form can retrieve and store data, but can present only the current occurrence of the outermost entity (and its contents) for editing.
H (Non-Editable Form) Only applicable for Form components. The Form can retrieve and display data, but the user cannot edit the data.

Description

By default (Data Access= N), components have full database access, which means that data can be read from the data source, modified in the component, and modified data can be stored in the database. During a store action, the write, lock, and validation triggers are executed to ensure data integrity.

You can prevent a component from storing data by setting Data Access to it L (Read-Only). Even if the write, lock, and validation triggers contain code, it is never executed so it is not possible for the component to write data to the database.

Data Access Property in Form Components

You can use the Data Access property of a Form component to limit some aspects of the component's behavior, without having to program these limitations yourself.

Effect of Data Access Values of Form Component
Behavior N (Normal) L (Limited) R (Record) H (Non-Editable)
Field values can be edited. Yes Yes Yes No
Occurrences can be added and removed. Yes No No Yes
Modifications can be stored. Yes No Yes No 1
The validation triggers startModification, valueChanged, and validate are fired. Yes Yes Yes No
The structure editor functions ^ADD_OCC, ^INS_OCC, and ^REM_OCC can be executed by firing the create and remove triggers. Yes Yes No Yes
The read, lock, and write triggers are fired. Yes No 2 Yes Yes
  1. If changes have been made in ProcScript rather than by the user, modifications can be stored.
  2. The store and erase statements return $status1, which prevents these triggers from being activated.

Record Form

A Record Form supports only one occurrence (record) of an outer entity in the component at one time. It does not have a hitlist of selected occurrences.

If the user retrieves an occurrence from the database using a retrieve profile on a Record form, Uniface first clears all data in the Form then retrieves a single selected occurrence from the database. If more than one occurrence matches the retrieve profile, only the first matching occurrence is retrieved.

Note:  If you define a Record component with two or more outer entities, during compilation Uniface adjusts the size of the first outer entity to encompass all the other outer entities on the component. (The first outer entity is the first one encountered as viewed top to bottom, left to right.) Therefore, using clear/e to clear data from the first outermost entity on a Record component clears data from all the entities on the component.

You cannot use the functions ^ADD_OCC, ^INS_OCC, or ^REM_OCC on a Record Form component. To remove an occurrence, use ^ERASE or ensure that there is no ProcScript in the component's erase trigger.

Non-Editable Form

A Non-Editable Form is defined as display-only. It is typically used to display static information, for example, in a non-database entity or using labels.

To compile any type of component, it must contain a component entity, even if the Data Access property is set to H.

Applies To