Using Prompt Maintainers within a Retrieval
The purpose of this document is to explain the process needed to have a user interface in which end-users enter a value on a Prompt page, then are redirected to a retrieval. The retrieval shows them the appropriate information based on the data entered from the Prompt.
To make this application, you will need to create the following:
· Retrieval (data output)
· New Table (In which the maintenance application will be written over)
· Redirect External Object (To link the Prompt to the data output)
· Maintenance (Prompt Page)
Step 1 — Build your Retrieval (data output)
When building your retrieval, please keep in mind what field you wish to pass to your retrieval. For instance, if I want my end user to search on customer name, I need to remember that the Customer Name field is CNAME. Otherwise, please build your retrieval as you normally would.
Note: Please remember the application number, as you will need it in Step 3.
Step 2 — Build your new table.
The purpose of this table is to serve as a container for your maintenance application data to reside in. In fact, once the data goes into this table, there is no need for the data to ever be examined. Create your table by going to the Admin screen, then click on the Registered Tables option. Lastly, click the “Create New Table” icon.
In the above picture, note that I created a two column table. One will hold a sequence key, while the other holds the name of the field that I wish to search on. In my case, this is the Customer Name field.
Note: The sequence field should be numeric.
Step 3 — Build your External Object
Click the Admin section, then select the “External Objects” option. Click the “Create Object” button.
· When selecting an Object name, please use 10 characters or less. When entering in the description, you are limited to 30 characters.
· Under Object Type, you must select the “URL Redirect” option.
· Under Classpath name, please enter the URL of the application you wish to be redirected to. In my case, the application is MRCWORKLIB.I00010s.
· You will notice, that I have added
?rls_CNAME=CT to the end of my URL. This is necessary as it tells the Inquiry to only show Customer Names that Contain a certain value.
Note: Please change CNAME to match the name of your field. Additionally, change the relationship from CT to the appropriate relationship.
Click Accept. Now that we have created the Redirection object, we need to pass a parameter. To do this, click the icon under the “Parameters” column. Then, click the “Create Parm” icon.
· Enter a useful description
· Under Parameter name, be sure to use “val_FIELDNAME” replacing FIELDNAME with your actual field name.
· Be sure to enter in the correct Parameter length, which needs to match the length of the field you created in Step 2.
· Lastly, set the “Required Field” option to “Yes”.
Step 4 — Create your Maintenance Application (The Prompt)
· The Maintenance application needs to be written over the table you created in Step 2.
· Be sure to use the “Single Record Maintenance” template.
· Choose all fields.
· Set the SEQNO field as the Sequence Key.
· Go into Field Settings, and change SEQNO’s field description to
SEQNO *AUTOSEQ. This will set this field as an auto-sequential field. Click Accept.
· Go into “External Objects” and select the Object you created in Step 3 under the “Select an Object” dropdown list.
· Select the “URL Redirect, After Action A/U/D (*REDIRECT)” location from the “Select a Location” dropdown list.
· Be sure that the correct field is mapped under the “Field” dropdown list. In our case, the field needs to be the Customer Name field.
Build your application and enter m-Painter. You should see something like this:
Right click on the SEQNO row, and select “Hide Row”. While the row will not be hidden within m-Painter, when the application is run, this row will be hidden. Please save your changes in m-Painter.
That’s it! Simply run your Maintenance application. Enter part of a Customer Name, and press Accept. Your Redirect External Object will take the user’s input and pass it to the Inquiry only showing you the valid records!