Skip 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.

How to stop a file from closing?

Featured Replies

I made a script to run on closing that asks the user to confirm before closing. If they click cancel, I want the file to stay open (I used the 'exit script' step unsuccessfully). If they click cancel it closes anyway. How can I stop it from closing if they click cancel.

Phil

Here's some help from the FM online help system

Get(LastMessageChoice) function

Format

Get(LastMessageChoice)

Parameter

None

Data type returned

number

Description

Returns a number corresponding to the button clicked in an alert message that is displayed by the Show Custom Dialog script step.

Returns:

1 for the first button (by default, labeled OK)

2 for the second button (by default, labeled Cancel)

That's a bit tricky. The close button is very severe.

The closest I've come to is this example, which on closing the main file opens a second "reopener" file. The "reopener" prompts the user asking if they want to close or not. If they say no, the "reopener" does what the file name suggests and reopens the main file.

In the 'close' script of the main file you'd probably want before closing to "save" certain things (eg current record, current layout) which you could then go back to with an "open" script called by the reopener. This would give the user the impression they hadn't closed at all.

close_dialog_example.zip

This is what you are looking for:

(Advanced only)

best

Stuart

CloseMe.fp7.zip

  • Author

Thanks ideal. I was using a Get(LastMessageChoice) but that wasn't the part that didn't work. See below James has answered the Q.

Many thanks,

Phil

  • Author

Thanks James that did the trick.

  • Author

Thanks Stuart that works even better (in your file) as no second file is needed.

I imported the script but didn't know what the custom menu thingy was all about or how it worked. Clearly it's important since the script didn't work in my file without it. No surprises there I suppose.

Phil

The file loads the custom menu set on startup

The File > Close action has been modified to perform the close script when the Close command is performed.

  • Author

Thanks Stuart I think I've got it now

Phil

Edited by Guest
Read it a few more times

:)

Just a side note for others, this will not stop the window from closing when the user clicks the 'X' to exit the FM application on the WINDOWS platform though.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.