Step 1 Add Virtual Fields to Employee File

Visual LANSA

Step 1. Add Virtual Fields to Employee File

REP008 - Virtual Fields

In this exercise, you will see how the multi-add field feature can be used to create fields in the repository as they are added to the file.  You will use these new fields as virtual fields in the Employee file.

1.  Open file iiiEmployees in the Editor. 

2.  In the Fields in File tab, Select the Designer button on the ribbon and expand the Add menu to select Multi-add fields. The Add Fields to the File window is displayed.

3.  Add the following fields (where iii=your initials). Remember to tick the Virtual check box.

Field Name

Description

Type

Length

Dec

Virtual

iiiTaxAmount

Income Tax to Deduct

Packed

6

2

ü yes

iiiFullEmployNumber

Full Employee Number

Alpha

9

 

ü yes

iiiEmployYears

Years with Company

Packed

2

 

ü yes

iiiNoteLength

Length of Notes as Characters

Packed

5

 

ü yes

 

     The autocomplete feature will attempt to match existing fields in the repository and will leave default values that need to be changed. Be sure to enter the correct descriptions, type, length, decimals and set the virtual flag.

4.  Press OK.

5.  When prompted to create the fields, click the Create All button.

6.  Your new fields in the file will appear like this:

7.  You need to make some modifications to your new fields in the Repository:

a.  Right-click iiiTaxAmount field and choose the Open option from the context menu:

b.  Make the Edit Mask A.

8.  Save and close the field.

9.  Open the iiiNoteLength field in the Editor.

a.  Change the Edit Mask to be 2.

10. Close and save the field.

      Note that there are warning messages for the new virtual fields indicating they do not have a derivation logic.