One way to use an Update Assist procedure is to call
it from a WebFOCUS report. You can set up the WebFOCUS report so
that a user can click on a row in the report and open the Update
Assist procedure with the data from the row of the report.
x
Procedure: How to Call an Update Assist Maintain Procedure From a WebFOCUS Report
-
Create
an Update Assist procedure that includes the following selections:
-
In the Update Assist (Step 2 of 4) - Navigation Options window,
select No key values required for your user interface.
-
In the Update Assist (Step 3 of 4) - Output File Options window, note
the names of your procedures. By default, Update Assist names them
after the segment they are modifying in the data source.
-
In Report
Painter, create a report using the same data source you used for
the Update Assist project. The report must contain the key fields
in the segment you want to update (if you do not want to view them
in the results, you can make them invisible).
-
Right-click
the column you want to make clickable in the report, then select Options from
the menu.
The Field Properties dialog box opens.
-
Click
the Drill Down tab and select Column
Data from the active object drop-down list. This means the
users cannot drill down from the title of the column in the report,
only by clicking on the column data.
-
In the
Drilldown Type drop-down list, select Maintain Procedure.
This specifies that when the user clicks on one of the last names
in the report, a Maintain procedure is executed.
-
In the
Procedure name field, type the name of the Maintain procedure you
want to execute.
-
Specify the parameters that get passed
to the Maintain procedure:
-
Click Add in the With Parameters section.
The Drill Down Parameter dialog box opens.
-
For each key field in the segment, enter the following in the Parameter
name field:
segname_fieldname_Edit
where:
- segname
Is the name of the segment that contains the key field.
- fieldname
Is the name of the key field (a key field uniquely identifies
a record in a segment).
- _Edit
Must be typed exactly as shown. This is the convention for
naming variables in Update Assist.
-
Click OK.
-
Repeat for each parameter that is to be passed to the Maintain procedure.
Note: You must pass all key fields needed to locate
the record you want to update, otherwise, the Maintain procedure
will not have enough information to uniquely identify a record.
For example, in the CAR file, if you wanted to update a particular
car model, you would need to pass the country and car, as well as
the model type to locate the model field.
-
In the
Drill Down tab, ensure the key field is selected in the list of parameters.
-
Click OK.
-
Close
your procedure and save it.
When
you run your report, you will see that all of the items in the selected column
of the report are underlined and clickable. Clicking any item on
the report opens the Update Assist form with the information for
that item already filled in.
xCalling an Update Assist Project From a WebFOCUS Report Example
This example describes how to
create a report in Report Painter and then create a link to a simple
Update Assist application that will update information in the report.
This example is broken down into two
steps:
- Create an Update
Assist project that updates an employee from the empdata data source.
See Creating an Update Assist Project For the Empdata Data Source.
- Create a report
in Report Painter that contains a simple list of the employees in
the empdata data source. See Creating a Report With the Empdata Data Source.
When you are done, you will have a WebFOCUS report that displays
a list of customers in the employee data source. Clicking on the
PIN adjacent to the last name of someone in this report will bring
up a form where you can change information about the employee, or delete
the employee from the data source. The result is shown in the following
image.
Example: Creating an Update Assist Project For the Empdata Data Source
The following is an example of creating
an Update Assist project for the empdata data source.
- Create a project.
- Add the IBISAMP directory
to the viewable directories for the project.
- Add the empdata Master
File to your project.
- Right-click
the empdata Master File and click Update
Assist in the pop-up menu.
The Update Assist (Step
1 of 4) - Select Segment & Field Options window opens.
- In the Update
Segment Options section, set Update to Yes.
- In the Field
View Options section, set Changeable to Yes for
all fields except PIN, which is a key field. The window is shown
in the following image.
- Click Next.
The
Update Assist (Step 2 of 4) - Navigation Options window opens.
- Select No
key values required and a color scheme from the supplied
examples and click Next.
The Update Assist
(Step 3 of 4) - Output File Options window opens. You should only
see one file here, empdata.mnt. Update Assist derived the file name
from the segment name. You can change it if you wish, but if you
do, make a note of the name you use, since you will need it when
you create your report.
- Click Next.
The
Update Assist (Step 4 of 4) - Summary window opens.
- Review the
summary of options you have chosen, and ensure Automatically
run this project when you press the 'Finish' button is
selected.
- Click Finish.
WebFOCUS
Maintain creates the .mnt files based on the options you selected
in Update Assist, and deploys them. During deployment, the Deploying
Application window opens.
- When the button
at the bottom of the Deploying Application window turns to Close instead
of Cancel, click Close.
WebFOCUS
Maintain displays the first screen of the application you created,
as shown in the following image.
Example: Creating a Report With the Empdata Data Source
- Create a procedure
that uses Report Painter:
- Right-click
the Procedures folder in the project that contains the Update Assist
procedure, and select New from the pop-up
window, then select Procedure.
The Add
Procedure dialog box opens.
- Type update in
the File Name field, select Report Painter from
the Create with drop-down list, and click Open.
The
Open dialog box opens.
- Select empdata and
click Open.
Report Painter opens.
- Place the LASTNAME, FIRSTNAME, DEPT,
and TITLE fields in the report. Select the PIN field
and click By to sort by the PIN field.
- Right-click
the PIN field on the report, and select Options from
the menu.
The Field Properties dialog box opens.
- Click the Drill
Down tab.
- In the active
object drop-down list, select Column Data so that
the users cannot drill down from the column title PIN,
only from the data in the report.
- In the Drill
down Definition drop-down menu, select Maintain Procedure.
This specifies that when an user clicks on one of the last names in
the report, a Maintain procedure is executed.
- Select empdata.mnt from
the Procedure Name drop-down list (or, if you renamed your procedure
when you created your Update Assist application, enter the new name).
The
Field Properties window appears as shown in the following image.
- Specify the
parameter that gets passed to the Maintain procedure empdata:
- Click Add in
the With Parameters section.
The Drill Down Parameter dialog box
opens.
- Select EMPDATA_PIN_Edit
from the Parameter name box.
- Select the
Field option and select EMPDATA.EMPDATA.PIN in the Parameter value
section.
- Click OK.
The
Drill Down Parameter dialog box opens, as shown in the following
image.
- Close your
procedure and save it.
When you run your report, you will see
all of the PIN values in the report are underlined and clickable,
as shown in the following image.
Clicking
a PIN on the report opens the Update Assist form with the information
for that name already filled in.