Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I have a script which opens a new (dialog) window for user to enter information. The script pauses while information is entered.

I want to allow the user to cancel the script (i.e. leave User Abort on) but if they do, I want the record to revert and the window to close automatically.

I tried:

If [ Get (Script Result) = "Cancel"]
Revert Record/Request [ ]
Close Window [Current Window]
Exit Script [ ]

but that doesn't seem to work.

Any thoughts?

if your script is paused then you can not use get(scriptresult) since you are still within the same script,

Use get(lastmessagechoice) instead

12 hours ago, millmaine said:

I want to allow the user to cancel the script (i.e. leave User Abort on)

Aborting a script and cancelling a dialog are two very different things. If the script is aborted at some point, then it doesn't matter what steps it contains after that.

As Wim said, use Get ( LastMessageChoice ) to get a user's selection from a custom dialog. But your script example and the wording of your post leads me to suspect that you aren't using FileMaker's built-in custom dialog, but a new window with the modal dialog window style. If the user is clicking a "Cancel" button in that layout while the script is paused, have that button set a global variable (and to resume currently paused scripts), and have the main script check that variable instead of Get ( ScriptResult ). If the user really is canceling the script, and not just triggering another script while the first script is paused, then you can do your clean-up in a separate script called with an OnTimer trigger.

Edited by jbante

  • Author
7 hours ago, jbante said:

As Wim said, use Get ( LastMessageChoice ) to get a user's selection from a custom dialog. But you're script example and the wording of your post leads me to suspect that you aren't using FileMaker's built-in custom dialog, but a new window with the modal dialog window style. If the user is clicking a "Cancel" button in that layout while the script is paused, have that button set a global variable (and to resume currently paused scripts), and have the main script check that variable instead of Get ( ScriptResult ). If the user really is canceling the script, and not just triggering another script while the first script is paused, then you can do your clean-up in a separate script called with an OnTimer trigger.

You're correct. The link to the OnTimer trigger seems to deal with exactly my issue. I'll download the sample file and explore that.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.