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.

Question on a calc for Privileges (browse records)

Featured Replies

I was playing with some calcs for the Browse Records section of Privleges. Something like this for comparing one field to another seems to work:

If(gGroup 1 = Group 1, "1", "")

Or a variation like this works:

gGroup 1 = Group 1

But when I try to do multiples like the following it does not work.

If(gGroup 1 = Group 1, "1", "") or

If(gGroup 2 = Group 2, "1", "") or

If(gGroup 3 = Group 3, "1", "") or

If(gGroup 4 = Group 4, "1", "")

Any tricks to get this to work? I tried replacing the "or" with "&", but of course that will not work because then all four would have to match for the calc to work. I am trying to set it up so that if any one of the four match up that "Browse Records" is available.

LR

The syntax is wrong. The case statement is easier than if's

Case(

gGroup1 = Group 1, 1,

gGroup2 = Group 2, 1,

gGroup3 = Group 3, 1

gGroup4 = Group 4, 1,"")

That'll work. however, since the tests themselves produce boolean results, you could dispense with the function altogether and simply use:

gGroup1 = Group 1 or gGroup2 = Group 2 or gGroup3 = Group 3 or gGroup4 = Group 4

That will produce a 1 if any of the tests are true, and a zero if all of them fail.

  • Author

gGroup1 = Group 1 or gGroup2 = Group 2 or gGroup3 = Group 3 or gGroup4 = Group 4

AAAGGGHHH

I had already tried that one, but it does not work right...although I would think it should.

gGroup1 = Group 1 by itself works.

gGroup1 = Group 1 or gGroup2 = Group 2 or gGroup3 = Group 3 or gGroup4 = Group 4 ends up allowing browse privleges to all records. Yet I can go to a one of the records and clearly see that none of the four fields in the above calc match, so logically the record should not be able to be seen.

Even more perplexing:

gGroup1 = Group 1 or gGroup2 = Group 2

Allows me to view all the records where gGroup = Group 1, but I can't see any of the records where gGroup2 = Group 2, although there are records where this is the case.

LR

Double check that your global fields are actually defined as globals and not text or number fields.

Bob's point is very valid. Good one.

Also check that the data type specified for the pairs of fields matches. If you are trying to match up a global number field with a text field - or vice versa, that will cause the tests to behave in a way which appears erratic.

  • Author

Oh praise be...

That was what seemed to be the problem. I had one of the fields that was not set correctly as a global. That seemed to clear it up.

Just a quick question...since I have not used access privleges for browse records before. It seems that by doing so, this REALLY slows down the database when opening. I assume this is because when opening the file it is doing a search of all the records to find a match for gGroup1 = Group 1 or gGroup2 = Group 2. Is this slowness just the nature of the beast? Right now I only have about 250 records, what happens when it grows to 2000 records?

LR

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.