Step 1 Create your Real By Name Filter

Visual LANSA

Step 1. Create your Real By Name Filter

In this step, you will create a real filter which searches the PSLMST file by employee surname. You will also learn how to use the Program Coding Assistant.

1.  Click the Program Coding Assistant button in the By Name filter.

The Program Coding Assistant window is displayed. It allows you to create different types of components that can be plugged into your filters, instance lists and command handlers. It is strongly recommended that you use the Program Coding Assistant when you first start using the Framework.

Initially you will most likely use filters that generate a component that can be executed (e.g. Filter that searches by all logical views of a file, Filter that searches a file or view). As you progress you might only use a skeleton filter or simply copy from one that is similar to one that you want to create.

2.  If you are using a non-English system, click on Framework / Your Framework in the top-left tree view. The Set LANSA code generation preferences option appears at the bottom. Select this option and set your preferences.

3.  In the list on the top left, select the iii HR application and then the By Name filter.

4.  Underneath it, select Windows as the platform. Entries in this list will depend on which platforms are enabled in your framework.

5.  As the type of code you want to generate, select Filter that searches using a file or a view.

6.  Click the Next>> button.

7.  On the next page specify PSLMST as The physical file that most closely resembles this business object.

The Program Coding Assistant guesses the Visual and Programmatic Identifiers required:

  • A Visual Identifier is the field or fields that a user would use to identify a unique instance of the business object.
  • A Programmatic Identifier is the field(s) that the program would use to identify a unique instance of the business object. Typically these would be the primary keys of the file or files that make up the data in the instance list.
  • The additional columns represent the additional columns in your instance list that you may have added during the prototyping phase.

8.  Click the Next>> button.

9.  On the next page specify PSLMST2 as the view to be used for filtering/searching operations. It is logical view of the PSLMST file keyed by the SURNAME and GIVENAME fields.

  • Note that you need an appropriate logical file for each filter that you want to create. Before implementing all your filters, review your data model to confirm that all the logical files exist. Doing so will speed up the process of implementing your prototype.

10.Select the SURNAME field as the key of the view to be used for search operations.

11.Click the Next>> button. Ignore the options on this page.

12.Click the Next>> button.

13.On the next page click the Generate Code button.

     The Generated Code page displays the source code for your filter. You now need to create the component that will contain this code:

14.Specify iiiCOM21 as the name of your real filter and By Name Filter as the description. (iii are your initials If you are using an unlicensed or trial version of Visual LANSA, you must always use the 3 characters DEM to replace iii).

15.Click the Create button to create the component in Visual LANSA.

     After a brief delay the message Created in the development environment is displayed.

16.Switch to the Visual LANSA editor and compile the component.