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 3 of 6) - Navigation Options window,
select No key values required for your user interface.
-
In the Update Assist (Step 5 of 6) - Output File Options window, note
the names of your procedures. By default, Update Assist names them
after the segments they are modifying in the data source.
-
In the
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).
-
Select
the column you want to make "clickable" in the report, then select Options from
the Properties 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 Definition 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.
-
Enter
the name of the Maintain procedure you want to execute in the Procedure
name field.
-
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 the
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 a customer from the Videotrk data source.
See Creating an Update Assist Project For the Videotrk Data Source.
- Create a report
in the Report Painter that contains a simple list of the customers in
the Videotrk data source. See Creating a Report With the Videotrk Data Source.
When you are done, you will have a WebFOCUS report that displays
a list of customers in the Videotrk data source. Clicking on the
last name of someone in this report will bring up a form where you
can change information about a customer, or delete the customer
from the data source. The result is shown in the following image:
Example: Creating an Update Assist Project For the Videotrk Data Source
The
following is an example of creating an Update Assist project for
the Videotrk data source.
- Create a project.
- Add the IBISAMP directory
to the viewable directories for the project.
- Add the Videotrk Master
File to your project.
- Right-click
the Videotrk Master File and click Update
Assist in the pop-up menu.
The Update Assist (Step
1 of 6) - Select Segment(s) for Auto Update window opens. For details,
see Update Assist (Step 1 of 6): Selecting Segments to Update.
- In the Select
lowest segment or hierarchy you would like to auto update section, select
the CUST segment.
The CUST segment appears
in the Segments section.
- In the Segments
section, select the CUST segment again. The
window appears as follows:
- Click Next.
The
Update Assist (Step 2 or 6) - Segment & Field Options window
opens.
- In the Update
Segment Options section, set Update and Delete to Yes.
- In the Field
View Options section, set Changeable to Yes for
all fields except CUSTID, which is a key field. The window appears
as follows:
- Click Next.
The
Update Assist (Step 3 of 6) - Navigation Options window opens.
- Select No
key values required, then click Next.
The
Update Assist (Step 4 of 6) - Template and Style Options window
opens.
- Select a color
scheme from the supplied examples, and click Next.
The
Update Assist (Step 5 of 6) - Output File Options window opens.
- Review the
list of files that your application will update. You should only
see one file here, cust.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 6 of 6) - 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 cust.mnt file, based on the options you selected in
Update Assist, and deploys it. 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
and displays the message "Record not found." This is because the
Maintain procedure that Update Assist created is expecting to be
passed to a parameter containing a value for CUSTID (the key field).
Example: Creating a Report With the Videotrk Data Source
The
following is an example of creating a report with the Videotrk data
source.
- Create a procedure
that uses the 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.
- Enter update in
the File Name field and click Open.
The
Open dialog box opens.
- Select Videotrk and
click Open.
The Report Painter opens.
The
Add Procedure dialog box opens.
The Open dialog box opens.
The
Report Painter opens.
- Place the LASTNAME, FIRSTNAME, CUSTID,
and PHONE fields in the report. Optionally,
select the LASTNAME field and click By to
sort by the LASTNAME field.
- Select the LASTNAME field
on the report, and select Options from the
Properties 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 LASTNAME, 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.
- Enter cust in
the Procedure name entry box (or, if you renamed your procedure
when you created your Update Assist application, enter the new name).
The
Field Properties window appears as follows:
- Specify the
parameter that gets passed to the Maintain procedure cust:
- Click Add in
the With Parameters section.
The Drill Down Parameter dialog box
opens.
- Enter CUST_CUSTID_Edit
in the Parameter name box.
- Select CUSTID from
the drop-down list in the Parameter value section.
The window
appears as follows:
- Click OK.
The
Drill Down Parameter dialog box opens.
The window appears
as follows:
- Close your
procedure and save it.
When you run your report, you will see
all of the last names in the report are underlined and clickable,
as in the following example:
Clicking
any name on the report opens the Update Assist form with the information for
that name already filled in.