Accessing Global Field Evaluates Relationship

Discussion created by vavo on Jun 8, 2017
Latest reply on Mar 23, 2018 by designdb



this is a bit of a question and a bit of a discussion.

Here is my situation:


I have a fairly larger system that has been around for about 20 years and many clients who use it. You can imagine that not everything has been added using best practices, but it is working very nicely. Or has been.


With a recent new version, I switched clients from using FM 11 to FM 15. This seems to have a caused a very specific issue which occurs in many places, but I will use one example here for the sake of discussion.

Since it is a legacy system, there are a lot of places Global fields are being used as temp storage, and as far as I know, when referencing a global field in a script, we should have "random access" to it, i. e. we can just gets its value whether or not is related.


What is happening now, and that seems to be different form 11 to 15, is that IF the utility table holding the global field is somehow related to the current context, Filemaker evaluates that relationship which makes it very slow at times. I was able to identify that using the top call log, cause all of a sudden my primary and foreign key fields where lighting up...


So here is an example of a relationship:


UtilityFields x Customers = Workorders = LineItems = WorkItemCatalog


In other words:

utility fields has a cartesian Join to Workorders, and then just simple single predicate relationships down the line.


For the sake of this discussion, lets assume I am in the context of WorkItemCatalog (yes, all the way down the line. I know, not a good idea, but bear with me). From there I try access a global field in utility fields and from all I can see, the whole relationship is evaluated, and if I am on a WorkItem which just happens to not be linked to a LineItem yet, it takes very long, trying and trying to built this relationship before it somehow still gets the value in UtilityFields.


The moment I disconnect UtilityFields from everything, I have instant access to all global fields, no delay at all.


To me, this does not make sense right now, so I am trying to understand it and am curious about any changes anybody is aware of in FM between 11 and 15 not why this might show now when it has not before.


Just an FYI:

The utlity fields table also has non-global fields in it and potentially multiple records, does that make a difference?


Thanks for comments, explanations and questions!