4 4 3 Types of Virtual Fields

Visual LANSA

4.4.3 Types of Virtual Fields

LANSA provides two methods of defining virtual fields:

  • LANSA extended definitions
  • RPG or C program coded definitions.

LANSA's extended definitions allow you to perform:

  • Substringing. For details, refer to Substring in the Technical Reference Guide.
  • Concatenation. For details, refer to Concatenation in the Technical Reference Guide.
  • Date conversion. For details, refer to Date Conversion in the Technical Reference Guide.
  • Code Fragment. For details, refer to Code Fragment in the Technical Reference Guide.

RPG or C coded definitions (refer to  Virtual Field Derivation in the Technical Reference Guide) may be necessary for complex actions such as:

  • type and length conversions
  • date to age conversions
  • dynamic data conversion.

LANSA trigger functions may also be used to create virtual fields. Trigger functions use RDML and provide an alternate option to using RPG or C for coding the virtual field logic.

A virtual field must be defined in the repository and may have field and file level validations associated with it.  Also, validation rules for the fields used in defining the virtual field are still enforced.  A virtual field can be used like any other field in the repository.

Virtual fields are not part of the real file and cannot be directly used outside of LANSA.  Virtual fields are made possible using LANSA's object access module. Client applications using LANSA Open and any applications which use the LANSA Object Access Module can access the LANSA virtual fields.

Also See

4.4.2 Distinction between real and virtual fields

4.4.1 Virtual Field Concepts

Ý 4.4 Virtual Field Development