Jump to content
Server Maintenance This Week. ×

Fields vs Portals


Jim Lah

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

Recommended Posts

Please can someone help my understanding of a simple relationships issue. The attached illustrates the problem.

I have a single table, with an ID and Parent ID to relate the tables occurrences together - 4 tocs are included each related in the same way.

I have a simple calculation which looks at the ID of the child toc. If the field is empty, it assigns "empty", if not it assigns "not empty" - ie simply detecting the presence or otherwise of a related record.

When I show the Portals for the 4 tocs in the layout, they display "Empty", "Not Empty" or nothing (if no record there) as expected.

However, if I show the associated field values, they always show "Empty" or "Not Empty" - even when there is no associated record in that relationship. How can this be if there is no record present to actually display the calculated result?

I'm sure someone out there will be able to explain this "feature".

Jim

POC_Table_Error.fp7.zip

Link to comment
Share on other sites

Yes, Correct.

That's all the calc is doing in this example. If there's nothing there is should say "Empty" - which it does in the Primary field

My problem is that where there is no valid relationship it also shows "Empty" in the secondary field - even though there should be no record there.

Link to comment
Share on other sites

It's certainly confused me as I have been using IsEmpty () thinking it was a reliable way of testing for a record's presence as well as for content of the field.

In the attached I've taken it a step further by comparing results with using If ( x = "" ; "Empty" ; "Not Empty ).

The results are even more confusing - none of them simulate the (correct) result as shown in the Portals. If I check the box to evaluate when records are not present, then it simulates the IsEmpty function - giving me Virtual records of some kind.

If I check the box not to evaluate if records are not present, then is does what you would expect.

Attachment shows the results.

POC_Table_Error.fp7_2.zip

Link to comment
Share on other sites

You may be reading too much into this. The difference between a field in a portal and a field placed directly on a layout is NOT in the evaluation, but in rendering.

When there's no related record, a portal row is completely empty - nothing is drawn there. Consequently, nothing needs to be evaluated. OTOH, a field placed directly on the layout must be rendered (put some borders on the fields to see the difference).

Once it's rendered, the question of what to put in it comes up. Since it's unstored and set to evaluate always, Filemaker evaluates it (note that IsEmpty() is used to check for the existence of related record, and thefore evaluates too). Thus you get the quirk of evaluating a field (correctly, it needs to be said) from the context of a non-existing record.

Link to comment
Share on other sites

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