mrc
Documentation
michaels, ross & cole, ltd.
http://www.mrc-productivity.com/
|
|
|
|
How to make a prompt maintainer
This article explains how to create a maintainer application that will allow an end user to enter in parameters which are then passed to another application. This will be helpful if you would like the end user to work with records containing specific values. In my example the second application is a work-with maintainer however you can also use the prompt maintainer to pass parameters to Retrievals, Reports and Summaries as well.
Outline
Application to receive parameters
The first step is to create an application that will receive parameters. As previously mentioned, you will be able to use prompt maintainers with in conjunction with other types of applications, this example will be with a Web 2.0 work-with maintainer. This will be the application that is receiving parameters entered by the end user.

Create prompt screen
from maintainer
The next step is to create a single record maintenance application. This will act as the prompt screen for the end user. Once at this screen, they will be able to enter specific data that will then be passed to another application and filtered.

There are several points to note when creating this maintainer.
First, this application must be created over a ‘dummy’ file. This file should contain fields with the same attributes (data type, size, etc…) as the fields in the second maintenance application. The purpose of the dummy file is to allow the ability to call an external object to redirect and pass parameters to the second maintainer without sacrificing data integrity of the main file. When the end user selects the Accept button, a record will be added to the file. In the case of the single record maintainer for prompt maintainers, we are only concerned with the redirect and passing of the parameters and not adding a new record to the file, hence the need for the dummy file. The dummy file can be created through Data Dictionary -> Manage Data Dictionary Tables -> Create New Table.
Also, be sure to set the SQL option to ‘Allow add, and allow duplicate records’. This option can be found under Application Properties -> SQL Statement -> caseSensitive. Remember, when submitting search criteria through the prompt screen, the single record maintenance application is actually adding a record as well as redirecting and passing parameters. Since the record being added is to our dummy file, it’s okay to allow multiple records. This option can be selected through the Application Properties section in the allow_add section.
Now that we have our two maintenance applications created, the next step is to create an External Object that will do the redirect, as well as pass the parameters.
Create external
object to redirect and pass parameters from one application to another
From the Data Dictionary tab, select the Manage External Objects link and click Create. The settings we are concerned with are Object name, Object description, Object Type and Classpath name. The Object name and Object description can be decided by the developer, the Object Type needs to be set to U (for URL encoding) and Classpath name is the location of the work-with Maintainer.
DEAN.M00410s is the Data Dictionary and the application name of our work-with maintainer. The slnk=1 lets the application know that not only do we want to redirect to this application but also pass along some parameters, which leads me to the next step, adding a parameter(s).
From the Manage External Objects screen, select the link for Parameters and click Create. The settings we’re concerned with are Object parameter descr., Object parameter name, Object parameter length and Object parameter decimals (if the field is a numeric).

A parameter will need to be created for each field that is passing data to the next maintainer.
Now that we have the External Object completed, we now have to add it to the Maintenance Application. In this case we will be adding it to the single record maintenance application. First we must select the External Object from the Select an object dropdown and then *REDIRECT location (for complete listing of External Object locations please click here) and finally we will need to select any fields necessary for passing parameters. From here we will need to recompile our application and then we can test.

Finished product
The prompt maintainer is now complete, let’s see how it works.

In this first screen, we can see that there are three prompts for the end user to fill out. After the end user fills out the three text boxes and clicks accepts, these three attributes are then passed to the work-with maintenance application and filtered with the three parameters passed with the help of our external object.

Now the end user will be able to modify this existing record without out having to sort through all of the records in this file. Again, please note that the prompt maintainer can be used in conjunction with other types of applications as well.