Step 5. Add File Lookup PJF to Employee File
REP009 - Access Routes and PJFs
In this step you will add a PJF for the Department Description field from the iiiDepartments Department file to the iiiEmployees Employee file. By defining a PJF (Predetermined Join Field) in the file, you can access the Department Description each time the Employee file is accessed without writing extra code to access the Department file. This field will appear as if it is simply part of the Employee file, and will be retrieved by the OAM.
1. Open file iiiEmployees in the Editor.
2. Ensure that the
tab is visible. Notice that no PJFs have been defined.3. Select the
tab to add your new predetermined join fields.4. Select the IIITODEPT access route. Use the button on the ribbon, and select from the menu.
5. Complete the
tab, by enter the following characteristics:
PJF field |
iiiDeptDescPJF |
PJF Type |
Lookup |
Source field |
iiiDeptDescription |
Use the ellipsis button and
to select each field.Your
tab will now look like this:
The value of the iiiDeptDescription from the Department file will now be retrieved and returned to a LANSA program as the field iiiDeptDescPJF in the Employee file.
Note: Predetermined Join Fields are display only fields.
Your access route should now appear like this:
6. Select the
tab. Your field list should now appear like this:
7. Select the Select View Style button and change the display to
to get a different overview of your file:
Your
tab will now look like this:
8. Click the iiiDeptDescPJF field. Notice that it is possible to edit the PJF definition from the
tab.9. Compile the file and close it.