Sending events between windows--use case scenario
The following use case scenario describes how you can send an event from a child window to a parent window. When a user modifies a record in the Child Window form, an After Modify condition in the active link automatically sends an event to the Parent Window form and updates a table field.
Sending event from child window to parent window
(Click the image to expand it.) 
The concepts used in the following procedures are straightforward, so that you can easily reverse sending the event from a parent window to a child window.
To send an event to a parent window
- Create a form (for example, Parent Window).
- Create another form (for example, Child Window).
- Add a table field to the Parent Window form.
- Select the new table field.
- Edit the properties of the table:
- In the Properties tab, select the Tree/Table Property value, and click its ellipsis button.
- Enter Child Window in the Form Name field.
The columns of the table field in Parent Form must point back to the Child Window form. - Add the following fields to the Table Columns list:
- Request ID (Column)
- Submitter (Column2)
- Short Description (Column3)
- Assigned To (Column4)
These columns help you identify which records in the table field to modify.
- Create an active link (Child Send Event to Parent After Modify) with a Run Process action.
- Configure the settings in the following panels:
- Associated Forms: Child Window
- Execution Options: After Modify
- Run If:'Submitter' != 'Assigned To'
You want the active link in the child window to fire if the submitter and assignee are not the same user.
- Right-click on the If Actions tab, and select Add Action > Run Process.
In the Command Line field, enter:
PERFORM-ACTION-SEND-EVENT @ "RefreshTable"
This Run Process command sends the RefreshTable event to the parent window. You will use this same event string later in active link workflow to catch the sent event in the parent window.This Run Process command and its special syntax can send messages to one or more windows. For example, to send an event to all windows, use PERFORM-ACTION-SEND-EVENT * "All Windows". You can also send events to a specific window:
PERFORM-ACTION-SEND-EVENT $536870921$ Processing
PERFORM-ACTION-SEND-EVENT $Short Description$ "network is down"
PERFORM-ACTION-SEND-EVENT $My Field$ "process request"
PERFORM-ACTION-SEND-EVENT $LASTOPENEDWINID$ "close now"This command uses an established mechanism in the client environments to support special commands that are not run as executables, but as internal commands within the client. For detailed information about the command syntax, see Using Run Process and $PROCESS$ commands.
- Configure the settings in the following panels:
- Create an active link (Parent Catch Event) with a Change Field action to catch the sent event.
- Configure the settings in the following panels:
- Associated Forms: Parent Window
- Execution Options: Event
Run If:$EVENTTYPE$ = "RefreshTable"
Because event names are intended to be unique, this active link fires only if it receives the RefreshTable event.You can trigger active links by examining the values of the EVENTSRCWINID, CURRENTWINID, or EVENTTYPE keywords in the Run If qualification. Here, the EVENTTYPE keyword is used in the Run If qualification to fire the active link if the parent window catches the RefreshTable event sent by the child window.
- Right-click on the If Actions tab, and select Add Action > Change Field.
- Enter the table field's name in the Field field.
- Select the Refresh Tree/Table check box.
Here the rows in the table field are automatically refreshed after changes are made to the underlying request.
- Configure the settings in the following panels:
- Open the Child Window form.
- As a test, create several tickets in the Child Window form, but create one ticket with John as the value of the Submitter and Assigned To fields.
- Open the Parent Window form, and click the table field to refresh it.
- Double-click the request assigned to John in the Results List to open the Child Window form.
Change the assignee to another name and make changes in the Short Description field (for example, enter Catch event in parent window), and then save the request.
When you modify the request, the active link workflow is triggered and sends the child window event to the parent window. The table field in the parent window is refreshed automatically.
If the target window is in the process of executing workflow, that workflow completes beforethe event is received.