Appearance
Custom Processing
You can include custom processing that will be run with your Request. For example, you can insert a command that runs a custom script after the query but before the output is produced. There are four stages at which you can insert custom processing in a Request.
- Before the query is created
- Before the query is run
- After the query is run
- After the output has been produced
You do this from the Custom Processing tab of the Workbench window.
Note: Custom processing requires technical knowledge. Generally your administrator will advise you of what custom processes to add.
To specify custom processing:
- Highlight the Request from the Request Manager.
- Right-click the Request and choose Edit from the menu.
- Go to the Custom Processing tab of the Workbench window.

- Specify the processes you want to run at the points you want them to occur in the "Add custom processing to these events" area:
Note: You may specify either an external program (such as a word processor) or a FoxPro program or subroutine (which requires some programming expertise to create). For examples, see one of the procedures listed in "External Programs You Can Run" below.
- Before query creation, run The command you specify here will run before the query (SQL statement) is created.
- Before query, run The command you specify here will run after the query (SQL statement) is created but before the query runs.
- After query, run The command you specify here will run after the query (SQL statement) has run and its results are returned to Foxfire!.
- After output, run The command you specify here will run after the output has been created. (For example, after creating a Request that produces a text file with data for a mail-merge, you could automatically launch a word processor to do the mail-merge.)
- Control how the SQL is generated by choosing one of these Query Creation Options.
- Filter before joining rows Affects the order of statements by forcing placement of the filter conditions before the join conditions in the SQL statement. Note: This may improve performance on queries with large tables.
- Use Inner Join Only (Foxfire! 3.0 Compatibility) Handles queries in the same way as Foxfire! did in version 3.0.
Note: This option is only applicable to Requests that were created in Foxfire! version 3.0. Some version 3.0 Requests have been converted to run in Foxfire! version 6.0. If you are unsure which version of a Request you have, please consult your administrator.
- Save SQL Normally, Foxfire! generates a SQL (query) statement each time the Request is run. Checking this option, will bypass SQL generation, and instead use a custom SQL statement that has been previously created and saved. For information on creating or modifying a custom SQL statement, see one of the procedures below. (Note you can also create a custom SQL statement from other areas of Foxfire! For more information, see Viewing and Modifying SQL for a Request.)
- Click Run to check your results.
To create a custom SQL statement:
- In the Query Generation Options area of the Custom Processing tab, click Create. If a stored SQL statement does not yet exist, Foxfire! will ask if you want to start with the system-generated SQL for the Request. If you choose Yes, Foxfire! generates the SQL and displays it for you to edit. If you choose No, Foxfire! provides a blank dialog box where you can type in a custom SQL for the Request.
- Click Edit to modify the SQL statement.
- Click Save when done. The Save SQL box is checked to alert you that the custom SQL statement will be run with this Request. The Create button changes to Edit.
- (Optional) Click Clear if you want to delete the stored custom SQL statement. Foxfire! returns to its regular process of creating a new SQL statement each time the Request is run. Foxfire! will use your stored SQL whenever you run the Request.
To modify a custom SQL statement:
- In the Query Generation Options area of the Custom Processing tab, click Edit to modify the SQL statement.
- Click Edit to modify the SQL statement.
- Click Save when done. The Save SQL box is checked to alert you that the custom SQL statement will be run with this Request. The Create button changes to Edit.
- (Optional) Click Clear if you want to delete the stored custom SQL statement. FoxFire! returns to its regular process of creating a new SQL statement each time the Request is run.
External Programs You Can Run
Your custom processing can be a separate program (written by a word processor or other type program), or subroutine (written in the FoxPro language only).
To run a Windows program:
- Choose when you want the custom processing to occur and type RUN in the appropriate box of the Custom Processing tab (see figure above)..
- Leave at least one space.
- Type /N to indicate that the program you are specifying is a Windows application.
- Leave at least one space.
- Type the name of the program to run. If your computer does not have that program in its automatic search path, be sure to specify the full path to the program as well as the program's name.
For example, to run MS Word for Windows, you would type:
RUN /N D:\WINWORD\WINWORD.EXETo run a FoxPro program:
- Choose when you want the custom processing to occur and type DO in the appropriate box of the Custom Processing tab (see figure above).
- Leave at least one space.
- Type the name of the program. (This can be a .PRG file or an .APP file.)
For example, to execute the budget save program, which is called BUDGSAV.PRG, you would type:
DO BUDGSAV.PRG
- In the Query Generation Options area of the Custom Processing tab, click Edit to modify the SQL statement.
Topic identifiers and source notes
Original topic: _1HJ0Q1DIZ · Help context: 89
Original filename: _1hj0q1diz.htm
Alternative source versions are retained for review. See this collection’s source notes.
Original page notices
Last Updated: 4/6/2007
