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.

Strange behavior in find mode.

Featured Replies

Hello,

Sorry for the long setup, but here goes:

I have a file called "Info" that has two layouts. One is called "General Info" and the other is called "Restricted Info". Users switch between the layouts by clicking buttons.

When the user opens the Info file they have to log in using a custom log-in system that I've come up with. They enter a user name and password. The user name is stored as a global field, gUserName. gUserName then forms a relationship with a file called "Users." The Users file has a record for each system user. The Users file has a field that indicates if the user in question is allowed to access the Info file at all, and another that further indicates whether or not he or she is allowed to access the Restricted Info layout of the Info database.

Within the Info file, when the user clicks the button to switch to the Restricted layout, a script is run which checks the User database to make sure that the user has permission to go to the Restricted Info layout. If they do, they go to the layout. If not, they are given a message that they don't have permission and need to see the database administrator.

This all works fine.

The problem comes when the user switches to Find mode. Suppose the user has permission for the file and for the Restricted Info layout. If they are in Find mode and are on the General Info layout, and then click the button to go to the Restricted Info layout, the script runs and they always get the message that they don't have permission to go the Restricted Info layout. The script works fine in Browse mode, but not in Find mode. Why? If I'm in Find mode is there a problem that the user name is stored as a global? What can I do to get around this?

Thanks for any insight,

Dan

Relationships don't exist in Find mode. Store your related information in local globals before entering Find mode and use these values to test permissions.

  • Author

OK, solved my own problem.

When I go into Find mode the Info file still has gUserName, but it doesn't know what record it is related to in the Users file. (I put a custom dialog box in the layout-changing script to display Users::UserName. This shows the user name when in Browse mode, but comes up empty when in Find mode.)

So I created an additional global field in the Info database, gHasAccessToRestricted. When the Info database is first opened, I use SetField to set gHasAccessToRestricted = Users::HasAccessToRestricted.

Then I changed the layout-changing script that checks whether the user has permission to view restricted data against gHasAccessToRestricted rather than Users::HasAccessToRestricted.

This works because it doesn't depend on a relationship, but on an internal field.

Thanks,

Dan

  • Author

Thanks, Queue. Your post handn't shown up when I started answering my own question. But that's the conclusion I came to. Working great now. But a lot of tedious script changes to make....

Thanks,

Dan

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.