|
请参考二次开发手册中的:
Passing Instructions to a Form
To pass information when navigating from one form to another when
both forms are already open, use the WHEN–FORM–NAVIGATE
trigger. You do not code this trigger directly; instead pass the
information through global variables.
To use this trigger, populate a global variable called
GLOBAL.WHEN_FORM_NAVIGATE with the name of a user–named
trigger. When a form is navigated to, this trigger fires.
The WHEN–FORM–NAVIGATE trigger fires upon programmatically
navigating to a form using the GO_FORM built–in. Accordingly, this
trigger is referenced into all forms.
Querying an Item
It often makes sense to navigate to a form and query on a specific item.
For example, suppose you have an Order Entry form ORDERS and a
Catalog form CATALOGS. You want to navigate from the ORDERS
form to CATALOGS and query up a specific part number.
• In the ORDERS form, create a global variable called
GLOBAL.PART_NUMBER, and populate it with the value you
want to query.
• In the ORDERS form, create a global variable called
GLOBAL.WHEN_FORM_NAVIGATE. Populate this variable
with the string ”QUERY_PART_NUMBER”.
• Create a user–named trigger in the CATALOGS form,
”QUERY_PART_NUMBER”. In this trigger, enter query mode
by calling EXECUTE_QUERY.
• Create a PRE–QUERY trigger in the CATALOGS form that calls
copy(’GLOBAL.PART_NUMBER, ’PARTS_BLOCK.PART_
NUMBER’). Then call copy(’’,’GLOBAL.PART_NUMBER’).
When there is a value in GLOBAL.PART_NUMBER, it becomes
part of the query criteria. |
|