Skip 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.

Turning a field on and off

Featured Replies

  • Newbies

How can i turn on (and off) a field in a calculation by using a button?

I want to be able to add a field when applicable, and turn it off when not needed. Can someone help me find a solution to this?

Thanks, Peter

First, I deleted the duplicate post in the Articles forum, as that was the wrong place, and this is the right one. Please don't post the same thing in 2 different places. It creates confusion and makes a continuous discussion difficult. Most of use the "Recent Posts" search, so we'll see both posts.

As to your question, the technique you're looking for is often called the "visibility" trick, from the example file of the same name by John Mark Osborne.

http://www.filemakerpros.com/Visible.zip

Do a search on Resources at the above site for other variations.

He explains it well. The basic technique is based on a self-relationship, which only evaluates true under certain circumstances. The field, or object, you want to hide or show are inside a portal based on this self-relationship. You can also put other layout objects besides fields inside it. Objects inside only appear when the portal's relationship is valid.

Buttons running scripts which are not visible will not respond to a click on their former location (though the "hand" will still show; best to turn it off for such buttons).

I downloaded the file and I am confused on how it works. I have a relational database. One table is a client database and the other is related client billing records. I show the billing records in a portal on the client database (there are many billing records per client). In the portal is Dateofbill, typeofbilling, amount, and datebillsent. if the typeofbilling is a payment I wanted to make it so the datebillsent field wouldn't show.

I suspect the Visibility trick is the way to go, but I just don't seem to understand it

The visibility trick won't work in a portal because it uses a portal and you can't have a portal in a portal. However, a word of advice, really study it until you can understand it; it is worth its weight in gold.

A calculation is the way to go. Daniele's idea is fine but a simpler way is

to set your button to

Set Field(ShowField; Case(Payment; ""; DateBillSent))

Edited by Guest

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.