REP010 - Access Routes and PJFs
In this step, you will modify your existing Search by Department Description form to include the predetermined join field Total Salaries. This field will show the total salaries per department.
1. Using iiiLIST tab, locate and open form iiiSearchDeptByDesc.
2. Drag the field iiiTotalSalaryPJF to the form.
3. Switch to the Source tab and modify the FETCH command and change the Fields() parameter to *ALL.
Fetch Fields(*ALL) From_File(IIIDEPARTMENTS) With_Key(#IIIDEPT)
This is a quick fix. A better solution would be to define a Group_By for the required fields and reference this in the FETCH statement.
Since this is a display only field, you would also change its ReadOnly property to True.
4. Compile your form. Check that the compile completed successfully.
5. Execute your form.
a. Fetch the Administration department.
Notice the value for the predetermined joined field Total Salaries. It shows the combined monthly salaries of all employees in the Employee file for the department you retrieved.
6. Close the form and close it in the editor.