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.

Logout script

Featured Replies

I'm trying to devise an easier way to do a logout script for my database. Basically all I want the script to do is set the g_user field to blank (easy enough), and close all open files except one. This will allow the user to login as someone else if need be.

Aside from writing a script that has close steps for every possible file that may be open (which I'll have to change once there is a new file added into the mix), is there someway I can do this easier? If not... No problem, but it would be nice to know either way. Thanks!

Hi,

The only way I can think of doing this is a very long way round and could be quite annoying for the user! Set your logout button to close FMPro. In the current database set up a close script which calls a vbscript which reopens FMPro and the current database.

Not sure how to do the calling vbscript bit put apparantly it is possible - think you need the File Toolbox Plugin

Actually thinking about it - this would be REALLY annoying and could take up to a minute to logout and log back in! Ignore the suggestion! - not good at all!

Ed

Why not use the Close [] script step to close the files?

I try not to ever quit FMP because the user might be working on other files in the program.

Put Close [] steps for each file in the solution. Only try to close one solution at a time.

This is a case where user education is the key, and no amount of programming is a replacement (in fact it often gets in the way).

Hi Vaughan,

AMEN!

Nothing is more aggravating to me then to be looking at a solution, and have my Application close just because the developer has put in a close FileMaker step instead of close file. My impression is that this developer thinks that His/her files is the only thing that counts and they don't care about what I have open.

What an EGO they must have.

Lee

I feel better now. crazy.gif

  • Author

Why not use the Close [] script step to close the files?

I try not to ever quit FMP because the user might be working on other files in the program.

Put Close [] steps for each file in the solution. Only try to close one solution at a time.

This is a case where user education is the key, and no amount of programming is a replacement (in fact it often gets in the way).

Yea, that's kinda what I was asking. I mean, other than doing a close [] for every possible file that may be open (depending on which files and layouts they were using). Well, I guess I could just call an external script in each file that would run it for me, therefore I'd only have to change one logout script if I added/deleted files.

You could have your close script point to an applescript that closes the opened files in your solution except one.

"depending on which files and layouts they were using"

Layouts are irrelevant to the issue, it's only files.

As I said earlier, I colse solutions as a whole. Hopefully you won't be frequently adding or removing files from soutions very often -- if you're still at that stage then you're in development, not production.

One function that is handy to work out which files are open is the DatabaseNames function, which returns the names of the currently opened files on the user's computer.

The way I do it is to use the same login procedure that users would use at startup (see a tip file named The Gateway at http://www.fmfiles.com)

When enetering the solution a login script is performed, bringing the user to a layout in which they have to enter username and password; in this layout you've 2 buttons, Enter and Cancel; the Cancel button would close all files.

So just create a Re-Login script that calls the same login routine; if a new user logs in s/he'll find already opened files, otherwise all files will close

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.