Two Calculations on the Same Object

Hi, everyone. I wanted to discuss an odd feature I discovered in FileMaker 13 that may be surprising for a number of you. As described in the title, you are able to have two calculations exist on the same object. This phenomenon occurs when you take an object with an existing invisibility calculation and turn it into a button. To better clarify, let’s utilize a few screenshots.

As seen in the following screenshot, I have a simple field named Test that has a hide object with a calculation of 1 = 1. This will result in the field always being invisible.

Simple test field

Now, let’s duplicate that field. It will retain its original hide calculation. Now, I am going to turn that field into a button. For this experiment, it does not matter what the button does, so I will simply have the button run the Beep command. Note that in the following screenshot the hide calculation has disappeared. The question is: has the functionality also disappeared?

Duplicated field

As seen in the following screenshot (or “not” seen in this example), it appears that the calculation (1 = 1) is still running and causing the button to hide. This occurs despite the calculation no longer being present in the Inspector.

Calculation running

Odder still, you can even add in another hide calculation for the button. So, you can have two hide calculations on the same object. This is visibly shown with two “eye” badges as seen in the following screenshot. If you remove the hide calculation from the button, you will return to a single hide calculation and one eye badge.

Two "eye" badges

Now, the question you might have is, “Do both of the hide calculations actually fire or is one deactivated?” The answer there is that it depends on the calculations. We ran a few tests here at Soliant and discovered that the second hide calculation (the one applied after the object is turned into a button) will fire before the original hide calculation. If the button hide calculation returns true, then the original calculation will not fire. However, if it returns false, the original calculation will be tested.

Practical Applications

I have not found a practical application for utilizing this feature as of yet, but it is an interesting discovery. If you ever need to have two separate hide calculations on a button object, know that the feature is available to you.

Download the Demo

The demo file contains the phenomenon that I have described. Make sure you go over to Layout mode to see what is happening.

Questions?

Our team is happy to share additional insights and answer any questions you have about using two calculations on the same object. Contact us today.

5 thoughts on “Two Calculations on the Same Object”

  1. Koen Van Hulle

    Nice catch.

    Under the hood, there is not one object, but two objects: the “group button” object, which is not the same as a button, and the “field” object. A “group button” contains the “field” object, just like a portal can contain field objects, or a regular grouped object can contain one or more fields.

    In FileMaker 11 and before, every button was in fact a “group button” object. This is no longer the case in FileMaker Pro 13 a button is just a “button” object.

    Koen

  2. hi john,
    quite an interesting reading/discovering! i just wonder if it happens “by coincidence” (the functionality, not your discovering 😉 or if it would be an intended behaviour.
    cheers
    pixi

  3. Stephen Dolenski

    John, just curious why compare 1=1 when the expected value to evaluate is boolean so a simple 1 or true would hide the object?

    perhaps try the option on one of them to apply in FIND Mode too?

  4. Good stuff. Object names work the same way. As Koen points out, the enclosing object is considered separate from any enclosing children, even if there’s only one child. What’s nice about this in 13 is that Refresh Object will tickle all the Hide Object Calcs enclosed within the called object, so some strategic naming and grouping can lean out your code and cut down on screen flash.

  5. It’s an interesting property for sure, but it can also be quite frustrating (also this was the behavior in 12 too). Consider adding any property to a field, eg a tooltip, hide calc, object name etc. If you then group & turn that into a button, you lose sight of any of that. I find this particularly infuriating especially if I have named the underlying field with an object name, it is totally invisible until the button object is ungrouped, so frustrating!

    I wonder what would happen if you set the hide condition on the field to false, but you then turned it into a button and set the hide condition on the button to true, would the field lose its “button” property and just revert back to a normal field, or would the entire thing disappear?

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top