Agent does not disconnect at runtime with window.close after an IWCTrigger event


Diagnostics

Product: App Studio
Release: 8206
Primary OS: Windows
Solution Date:

Problem

Clicking on a button that executes window.close after an IWCTrigger event in a case result in the agent remaining in use.

Solution

Here are the steps to address this issue:

  1. Create a variable (closeme) and place it on the form. Be sure visible is set to NO.
  2. Remove the winfom.close from the event.
  3. Add Compute Closeme = 'Y’ in the case performed by the IWCTrigger.
  4. Create a formOnLoad.js file.
  5. In the JavaScript file, test to see for the value of formname.Closeme_Edit.value =='Y'.
  6. If True, winform.close.
  7. Embed the JavaScript file on the form and add it to the Onload property of the form.

Now the form will close after it refreshes.