Step 2 Copy Fields

Visual LANSA

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 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 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 Copy option.

     A Create as copy of DEPTMENT dialog will appear.

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.  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 Save 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 Find dialog by pressing the Repository Find button on the toolbar.

b.  Check that Field is selected in the Object Type list. In the Find Text field enter empno and press the Find button.

c  Close the Repository Find dialog.

d.  In the Find Results 1 tab right click on the EMPNO field to display the context menu. Select the Copy option.

e.  The Create as copy of EMPNO dialog will appear.

f.  Enter a Field name of iiiEmployNumber (where iii are your initials).

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.  Create the iiiDeptDescription field by copying the DEPTDESC field.

a.Locate the field DEPTDESC on the Repository tab.

b.  Copy the rules and triggers.

c.  Select Open in editor 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 Details tab.

b.Select LC – Lowercase Entry Allowed

c.  Save and close the field definition.

7.  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.