Quantcast
Channel: Database – Soliant
Viewing all articles
Browse latest Browse all 50

Two Calculations on the Same Object

$
0
0

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.

Please find the attached file. It contains the phenomenon that I have described. Make sure you go over to Layout mode to see what is happening.

HidingObjects.fmp12

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.

The post Two Calculations on the Same Object appeared first on Soliant Consulting.


Viewing all articles
Browse latest Browse all 50

Trending Articles