Step 5. Create Test Form
REP008 - Virtual Fields
In this step you will create a form that will show the real fields and the virtual fields in the Employee file.
1. Create a form.
a. Enter the following characteristics for the form:
Name |
iiiMaintEmployVirtuals (where iii=your initials) |
Description |
Real and Virtual Fields in Employee File |
RDMLX Enabled |
ü Yes |
2. Once the
has opened, make your form wider.3. Display the iiiLIST tab and expand the iiiEmployees file to display the fields it contains. Notice that the real fields and the virtual fields have different icons:
4. Drag and drop all the real fields to your form. Select them as a group using the
5. Drag all the virtual fields next to the real fields.
6. Display the
tab and drag and drop a push button to the form.
7. With the push button select, on the Fetch.
tab, make the of the button
8. Display the Events tab and double click on the Click event to create an Click event routine for the button.
9. Display the Source tab of your form and add this code inside the event routine for #PHBN_1.Click replacing III with your initials:
EVTROUTINE HANDLING(#PHBN_1.Click)
Fetch FIELDS(*all) from_file(iiiEmployees) with_key(#iiiEmploynumber)
ENDROUTINE
Your form is now ready to compile.
10. Compile and execute your form.
a. Enter an Employee number and click
.b. Note how the virtual field values are based on the real field values.
11. Exit the form.
12. Close the form in the
.