Jump to content

Hiding Fields


This topic is 7301 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi Chris

I am guessing that the same trick for hiding fields in v6 will work for v7.

Say you have a price field, which you only want to be visible when a user is an administrator and you want hidden for other users. In the user file, you have a checkbox if the user is the administrator.

In the file where you want to hide the field, create a calculation field (call it Hide) that is something like:

If(user = "administrator", 1,0) - which says that if the user is an administrator, the value of this calculation is 1 - if not an administrator, the value will be 0.

Now, if you dont already have one, create a 'Constant' calculation, where the value in the calculation is simply a " 1 " - in other words, for every record, this constant calc will ALWAYS have a value of 1.

Now create a relationship between Hide and Constant - the relationship will be valid if both fields have a 1 in them - which will only occur when the user is an administrator.

Lastly, create a portal which only has one row, with no fill or border (altho it might be easier for testing, to give it a colour border and make it transparant later). This portal is set to the above relationship.

Now, any fields placed UNDER the portal will be invisible when the user is not an administrator.

I hope you can apply this example to your own situation - and if v7 has a quick and easy way to hide fields, then all I can is - About Time!!!1

Link to comment
Share on other sites

-Queue- said:

User = "administrator" is, of course, a boolean calculation, so the If(..., 1, 0) statement is redundant.

Thanks, Queue!

I've always stumbled on the boolean field definition vs. the If statement, and that simple statement just cleared it up. grin.gif Just thought you would want to know that I heard an audible "click" as I read that!

Paul

FileMaker Version: 6

Platform: Windows XP

Link to comment
Share on other sites

This topic is 7301 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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