Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Greetings all. Still very much in newbie-mode with FM, so bear with. Okay, let's say you have list of fields in a layout like this:

item1

item2

item3

Is it possible with a script (or other method) to produce a result like:

If <item3> = EMPTY then

do not display in Browse mode

else

display <item3>

end if

end

I know thats not FM's real scripting format, just sort of what I'm used too...but you get the drift, yes? smile.gif

Thanks in advance.

Posted

I must be missing the point of your question. If item3 is empty then there is nothing to display so it won't display on the layout. Are you trying to make something else disappear as well?

One way to do this is to put a portal on the layout which is designed to have no related records when item3 is empty (how you do this may be rather specific to your database) and then drop your show/hide design elements into the portal.

Posted

What I have going is a Layout with a series of fields formatted as value lists/pulldown menus. Let's say the list of "items" was fruit...and the user could select types of fruit, like this:

item1 = "bananas"

item2 = "peaches"

item3 = "pears"

Obviously the user could make it like this:

item1 = "pears"

item2 = "bananas"

item3 = "peaches"

Any combo works just fine. Now...in another Layout I have these same fields displayed, but they are formatted as Edit Boxes and the Field Behaivor does not allow entry in either Browse or Find modes. The net result creates an uneditable list based on the original Layout, like this:

pears

bananas

peaches

On the second Layout next to this list is a new group of fields (Edit boxes) which lets a user make comments about each item in the list, like this:

pears "We have enough pears on hand at the moment."

bananas "We will need 50 cases by next Tuesday."

peaches "We need 100 cases as soon as possible!"

I want the user to be able to define up to three fruit types, but three are not required. So, let's say "item3" is left blank on the original Layout. When you go to the second Layout, there is no uneditable list item, but there IS an editable comment field that isn't associated with anything.

So the heart of my original question is can FM "see" that "item3" is EMPTY in the original Layout and based on that data not display (hide, whatever) the comment field that is associated with "item3" in the second Layout?

I'm laughing at myself as I type out the explaination...have I only made things more confusing? Or perhaps I'm going at this the wrong way?

Thanks in advance.

Posted

Yes. Use the portal method described in the previous post.

You'll need a portal for each field you wish to be 'hidden'.

And probably a self-join relationship for each field as well.

The self joins will need to be the 'fruit' field related to an 'always calculated BLANK global' field so that if they DO NOT equal blank the portal relationship is valid, and the field (description / comment) which is IN the portal will only show on the layout if there is an entry in the 'fruit' field.

The opposite, blank fruit field, makes the relationship INVALID and the field doesn't show.

Posted

It might be even better to have the fruit selections in another table, so that you don't have to play around with the hidden portal trick. Just use a regular portal displaying the fruit field (with entry disabled) and the comment field from the "fruit" table. Then if you later decide to allow the user to select more or less than 3 fruits, your basic file structure is already set up to handle it.

This topic is 7221 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.