Step 2. Copy Fields
REP001 - Create Fields
In this step you will create fields called iiiDeptCode, iiiDeptDescription and iiiEmployNumber by copying the DEPTMENT, DEPTDESC and EMPNO fields that are already defined in the repository.
1. On the
, locate the field to be copied:a. Expand the Fields node (if Alphabetic Groupings is on, open the list of fields for the letter D).
b. Locate the DEPTMENT field. It is the code field used to identify departments.
c. Right click on the DEPTMENT field to display the context menu. Select the
option.
A
dialog will appear.
2. Enter the basic details for the field in this dialog:
a. Enter a iiiDeptCode (where iii are your initials).
ofb. Leave the Department Code.
ofc. Select (ü) the option to .
d. Select (ü) the option to .
e. Press the
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. Double-click Length. In the Details tab, change Field Length to 3.
b. Select the Rules and Triggers tab. Notice that there is one validation rule copied from the DEPTMENT field.
c. Press the
button on the Editor toolbar to save the field.
d. Close the field.
4. Create the iiiEmployNumber field by copying the EMPNO field.
a. Locate the EMPNO field using the
dialog by pressing the button on the toolbar.
b. Check that empno and press the button.
is selected in the Object Type list. In the field enter
c Close the
dialog.d. In the EMPNO field to display the context menu. Select the option.
tab right click on the
e. The
dialog will appear.f. Enter a iiiEmployNumber (where iii are your initials).
ofg. Do not copy the rules and triggers, visualization or help text.
h. Do not select (ü) the option to .
i. Press the
button.The field is created in the Repository but is not opened in the Editor.
5. Create the iiiDeptDescription field by copying the DEPTDESC field.
a.Locate the field DEPTDESC on the
tab.b. Copy the rules and triggers.
c. Select
so that you can edit it once it has been created.6. Specify that the department description can be entered in lower case.
a. Double-click on the Input attributes heading in the field definition to open the
tab.b.Select
c. Save and close the field definition.
7. On the
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.