This exercise is to create a simple contract enquiry screen. The screen will select contracts and return basic information from the jc_job record.
Create the Function
Create a new function
Field | Value |
Function Code | Initials + M1 + Exercise No.e.g. NLM1Exercise1 |
Function Name | Description identifier.e.g. NLM1Exercise 1 |
Function Type | Function |
Function Module | Contract Status |
Function Category | Browse |
Function Context | Leave as defaulted from the Function Description. |
Function Program | wou005 |
Create the Page
Create the page section (with the same name as the function).
Enter the information into the Page Header as follows:
Field | Value |
Header Table |
|
Body Table | jc_job |
On the Body Tab enter the following:
Field | Value |
| 12 |
Body Query | FOR EACH jc_job WHERE jc_job.kco = {kco} |
Click
to complete the Page Summary.
Create a Body Page Form
Select the Form tab and create a Body form to use Body Fields.
Click the
and enter the following information to create the Form :
Field | Value |
FormSelect | Body |
Field Type | Body |
Linked To | Leave blank |
Click the Save Button
to create the form.
Add the Fields
In the Fields Tab go to the FORM selector at the bottom of the page:
Select Body and click Apply Filter. This will determine which form you will work with.
The option below for Standard or Grouped will change the way the field details are displayed on the form. At this stage it does not matter whether you set Standard or Grouped as long as you have set the correct form.
You should always do this to ensure you are adding fields to the correct form β adding fields to an incorrect form will mean that they do not display.
Add the following Fields :
Field | Label | Width |
job_num | Contract Number | 10 |
job_phase | Phase | 5 |
job_name | Name | 20 |
jgr_desc | Group | 20 |
jty_desc | Type | 20 |
jcl_desc | Location | 20 |
job_active | Status | 5 |
You should check that your field widths add up to 100. The screen will still work if they do not, but the results concerning column widths may not be as expected.
Click Save after entering each field.
Adding a Sort to a Column
A column header can be used to sort the data.
To add a sort enter the field name followed by either a + for ascending or β for descending.
Edit the job_num field by clicking on the Open button
and in the Sort field add:
kco+,job_num+
This will also provide a simple search filter to the Enquiry screen.
Linking a Field to another Enquiry
A field on an enquiry can be linked to another enquiry β for example to DIG DEEPER into further information. This can be an existing standard enquiry or another user defined enquiry. Use the Function option in Field Maintenance to do this.
To link the job_num field to the contract record:
On the Function field enter %WJC5014SJOB (this is a standard coins enquiry).
Save the field.
Running The Function
Run the Function by adding &MainArea=yourfunctionname to the URL









