Step 4. Reference Fields
REP001 - Create Fields
Reference Fields: A field inherits these characteristics from its reference field:
• Type
• Length and decimal positions
• Edit mask and word
• Input and output attributes
• RDMLX enabled flag
• Default value
• Keyboard shift
When the definition of a reference field is changed, the characteristics of all fields that are based on it, are changed immediately.
In this step you will create two fields called iiiSurname and iiiGivenName. These fields will use the reference field feature of the LANSA Repository so that their characteristics are inherited from the shipped STD_NAME field.
1.On the tab, find the field STD_NAME and it to create a new field iii_Name.
a.Copy the
b.Do not open the field in the editor.
2. Create the iiiSurname field using the New button on the menu. Choose Field from the graphical menu.
a. In the New field dialog, enter:
|
b. Press the button.
Notice that the field type and length are derived from the reference field.
3. Select the button from the File menu and choose from the grahical menu to create the Given Name field (iiiGivenName). Alternatively you could use the Alt + F + N keys.
a. In the dialog enter the following characteristics:
|
b. Do not specify a yet.
c. Select the option to .
d. Select the option to so that the dialog will be closed.
e. Press the button.
4. The iiiGivenName field is opened in the Editor.
a. Click on Reference Field in the tab to open the tab.
b. In the tab type in iii_NAME as the .
The iiiGivenName field is now based on the definition of the III_NAME field. Notice, for example, that its field type is now Alpha and its length is set to 25. These characteristics are inherited from the reference field and cannot be changed.
c. Review the tab.
Notice that there are no rules. However, if you click on the button on the ribbon, you will see the option.
Do not adopt any rules at this stage.
d. Save and close the field.
5. Open the III_NAME field.
6. Change the Field length to 20.
7. Save the III_NAME field definition.
8. Locate the iiiSurname field on the tab. Right-click on the field and choose the option from the context menu.
The tab will be displayed, showing the field's definition:
9. Change the Field length of III_NAME back to 25.
10. Save and close the III_NAME field.