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.

Featured Replies

I realise this topic has been touched on before, however... I need to hide an object on my layout for a membership database. To do it, I need to meet the true and/or false values from two fields, 'Category' and 'Status', both of which are pop up menus. As I'm very new to the whole scripting and calculations thing in FM, I have literally spent hours today Googling solutions. These two that I've put together work perfectly when they're run separately:

FilterValues ( MEMBER::Category ; "All¶Donor¶Friend¶Navara¶Contact¶Potential Navara Funder¶Mailing List" ) ≠ "" 
  FilterValues ( MEMBER::Status ; "Inactive" ) ≠ ""

But try and put them together to run one after the other and I run into the issue of (to quote FileMaker Community Member 'egoist'), "With an OR, only the first predicate is evaluated if it returns True, since then the entire expression already is True, and there is no need to test further. Same with AND and False." So yep I have the same problem.

I've seen examples using Case functions and Get, but I can't seem to get them to work. Any suggestions would be most appreciated.

Could you explain, in simple language, when exactly the object should be hidden (or shown)? It's hard to guess what you're trying to accomplish by looking at code that doesn't.

 

Edited by comment

  • Author
1 hour ago, comment said:

Could you explain, in simple language, when exactly the object should be hidden (or shown)? It's hard to guess what you're trying to accomplish by looking at code that doesn't.

 

The database has a field that shows when members joined - so that's a date field. It also has a field that is a pop up where you can select what category they fit into. Be it a Member, Donor, Friend, Navara, Contact, Potential Navara Funder, on our Mailing List or you can select All. There is also another pop up field that you can select whether they're an Active or Inactive Member.

From these three fields, there is a resulting field with, the help of a date calculation, that adjusts their joining date to show when their membership is up for renewal in 2019. However, what I'm trying to do is only display the resulting field based on 'Members' who are 'Active'. So for all the records in the database for those people who don't fit the pop up criteria of 'Member' 'Active', I want to hide their 2019 date. That way we can see when active members have upcoming renewals due.

The attached screenshots might help explain it better. The first shows a 'Member' who is 'Active'. You can see when he joined and when his membership is due on the bottom right. But this is only pulling in the Membership Due date based on the 'Category' field not the Status field as well which is the 'Active' 'Inactive' field. The second screenshot shows someone who is on our 'Mailing List' and is 'Inactive'. You can see when he originally joined but there is no date showing for a membership renewal, which is what I want it to do. 

So I'm trying to combine the two FilterValues to filter the two fields 'Category' and 'Status'.

 

Screen Shot 2019-09-01 at 9.47.11 am.png

Screen Shot 2019-09-01 at 9.48.18 am.png

Edited by James Carter

I am afraid all I understood from this is:

16 minutes ago, James Carter said:

So for all the records in the database for those people who don't fit the pop up criteria of 'Member' 'Active', I want to hide their 2019 date.

Which would translate to 'Hide the date field when':

MEMBER::Status ≠ "Active" 

You did not say anything about how the contents of the Category field should influence the decision whether to hide the field or not.

 

  • Author
44 minutes ago, comment said:

I am afraid all I understood from this is:

Which would translate to 'Hide the date field when':


MEMBER::Status ≠ "Active" 

You did not say anything about how the contents of the Category field should influence the decision whether to hide the field or not.

 

Maybe I'm trying to explain it in too much detail. In its simplest form, when the Category field is selected as 'Member' and the Status field is selected as 'Active', display the 'Membership Due' date.

And that's the only time to display that date, when those two criteria are met.

So based on that, how do I combine the two hide object behaviours? Do I use Filter Values or something else? As I said initially, you can't have two FilterValues in the one calculation. I had these two which work fine individually, but how do I combine them into one calculation.

FilterValues ( MEMBER::Category ; "All¶Donor¶Friend¶Navara¶Contact¶Potential Navara Funder¶Mailing List" ) ≠ "" 
  FilterValues ( MEMBER::Status ; "Inactive" ) ≠ ""

3 hours ago, James Carter said:

In its simplest form, when the Category field is selected as 'Member' and the Status field is selected as 'Active', display the 'Membership Due' date.

This I would write equally simply as:

not ( Category = "Member" and Status = "Active" )

which, by De Morgan's laws, is exactly the same thing as:

Category ≠ "Member" or Status ≠ "Active"

 

  • Author
33 minutes ago, comment said:

This I would write equally simply as:


not ( Category = "Member" and Status = "Active" )

which, by De Morgan's laws, is exactly the same thing as:


Category ≠ "Member" or Status ≠ "Active"

 

You sir or madam (I'm not sure which), are a genius. It works perfectly and is exactly what I was after. Thank you for your assistance.

Well, it was simple once you put it simply.

Just for completion, note that combining your original conditions with OR would have produced the same result in almost every case - except when one or both fields is empty or contains a value that isn't listed explicitly in your expressions. The "issue" you mentioned  in the opening post isn't an issue at all.

 

  • Author
33 minutes ago, comment said:

Well, it was simple once you put it simply.

Just for completion, note that combining your original conditions with OR would have produced the same result in almost every case - except when one or both fields is empty or contains a value that isn't listed explicitly in your expressions. The "issue" you mentioned  in the opening post isn't an issue at all.

 

Ok thanks for that quick lesson, I'll remember that in the future. Appreciate your help.

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.