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.

The simplest things...

Featured Replies

I have put together a script that will check the user to see if he/she has the appropriate permission to a particular layout. The script is great with the one exception that IT DOES NOT WORK.

Am I on the right track...?

If["PatternCount(Status(CurrentUser), "Joe")"]

Show Message ["You do not have the appropriate permissions to access this layout."]

Else

Go to Layout [secret Layout]

End If

Why does it not work?

It kind of depends on what you intended the script to do. What this one does is looks for the name "Joe" in the current user name and if it is found doesn't allow access. Did you intend to allow "Joe" access? If so you either need to put a "not" in front of the If statement condition or switch the Show Message and Go to Layout steps.

-bd

  • Author

OK, I must be confused. I modified my original script to this...

If["Status(CurrentUserName) = "mtnbiker""]

Go to Layout ["Test Layout"]

Else

If[isEmpty(Status(CurrentUserName))"]

Show Message ["You must have a user name for access."]

End If

End If

I have used the password 'mtnbiker" to get into my database. What exactly is user name in 'CurrentUserName'? Is it the password or is the actual user name used to log onto my local network? What am I doing wrong? The above script just keeps giving me my message that I do not have a user name. Ideally, I would like to use the password to allow/disallow users access to certain layouts.

HELP!

If you look under “Edit/Preferences/Application” in FM you’ll see the user name – this is the value used by FM in the status option. It is usually the name of the computer that the logged in guest is using, unless he/she has changed it. The user name in FM has nothing to do with the password.

So, in this case if you want to use a script which can only do certain things if a particular user is using it (lets say the user is Rigsby) then you need to shut all other users out of the script. So to do this you were on the right lines with your “IF” statement, but you need to use a “NOT” as liveOak said, or I would simply use the “something other than” option, i.e.:

If [status(CurrentUserName) <> "Rigsby"]

Then you can tell the script to do what you want. E.g. Show message:

“You don’t have the necessary rights to access this layout”

etc., etc., etc.

The bad news here is if someone else is on your work station.

On the other hand, you can use the access privileges (under the menu "File") in FM to decide who can do what in your files. The FM help-files or handbook describes this pretty well. If you don’t have any experience with the FM access privileges, make a backup of your files before you start to experiment.

Hope this helps,

Rigsby

  • Author

Thanks Rigsby. That clarifies a lot. I think I will go with PatternCount(Status(CurrentGroups) instead.

This seems to work just as well. Thanks for the input.

I am aware of the locking out layouts in the access area. However, it is seriously inconveinent to the user when she/he receives an 'access is denied' screen and cannot do anything but close the program.

Once again, thanks for the input. Greatly appreciated!

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.