In this step, you will create fields called iiiDeptCode, iiiDeptDescription and iiiEmployNumber by copying fields that are already defined in the repository.
1. On the Repository tab, locate the field to be copied:
a. Expand the Fields node (if Alphabetic Groupings is on, open the list of fields for the letter S).
b. Locate the STD_CODE field.
c. Right click on the STD_CODE field to display the context menu. Select the Copy option.
A Create as copy of STD_CODE dialog will appear.
If you are using a free trial version or an Independent Workstation, your initial settings will not show the Identifier on the create dialogs.
2. Enter the basic details for the field, in this dialog:
a. Enter a Field name of iiiDeptCode (where iii are your initials).
b. Leave the Description of Department Code.
c. Select (ü) the option to Copy rules and triggers.
d. Select (ü) the option to Open in editor.
e. Press the Create button.
Do not enter an Identifier. This will be generated.
You can press F1 to access the online help for details about any of the field parameters.
A red triangle in an input field indicates an error. Usually this happens when the value in the field is blank or incomplete. To see the error message click on the red triangle.
3. The iiiDeptCode field is opened in the LANSA Editor to allow you to edit other field characteristics.
a. Note that we have created a 3 long, alphanumeric field.
b. Select the Rules and Triggers tab. Notice that a "must not be blank" validation rules has been copied from the field STD_CODE.
c. Click the Save button on the Editor toolbar to save the field.
d. Close the field.
4. This step will create the iiiEmployNumber field by copying the STD_CODEL field.
a. Locate the STD_CODEL field using the Find dialog by clicking the Repository Find button on the toolbar.
b. Ensure that Field is selected in the Object Types list. In the Find Text field enter STD_C, select Show results in New Tab Sheet and press the Find button.
c Close the Repository Find dialog. The Find Results tab will be displayed, listing 9 fields.
d. In the Find Results tab right click on the STD_CODEL field to display the context menu. Select the Copy option.
e. The Create as copy of STD_CODEL dialog will appear.
f. Enter a Field name of iiiEmployNumber (where iii are your initials) and Description of Employee Number.
g. Do not copy the rules and triggers, visualization or help text.
h. Do not select (ü) the option to Open in editor.
i. Press the Create button.
The field is created in the Repository but is not opened in the Editor.
5. This step will create the iiiDeptDescription field by copying the STD_TEXTS field.
a. Locate the field STD_TEXTS on the Repository tab.
b. Select Copy to create field Name iiiDeptDescription with Description of Department Description.
c. Check the box to Copy the rules and triggers.
d. Select Open in editor so that you can edit it once it has been created.
6. Review the Definition and Rules and Triggers tabs. Note you have created a 30 long, alphanumeric field which accepts lower case (Input Attribute = LC). It has a Must not be blank validation rule.
7. Save and close the field definition.
8. On the Favorites tab, select the Last Opened tab. Notice that the iiiDeptCode and iiiDeptDescription fields are listed but the iiiEmployNumber field is not. When you open any object in the Editor, it will be added to the Last Opened list.
Note: To remove objects from the Last Opened tab, select them and use the context menu to Remove from Last Opened.