Hi to everyone,
I’ve been trying to figure out some really bizarre behavior for a set of global fields I’ve set up for purposes of taking user inputs that are then translated into parameters for eSQL functions and Execute Data API script steps.
The global number fields in question are only ever intended to take quantitative values. But text that inadvertently makes it into these query parameters will mess up my eSQL results, so I set up an Auto-Enter Calculation to coerce any entry to a number. The Auto-Enter calculation is simply GetAsNumber (self) and “Do Not Replace Existing Value (if any)” is turned off.
If this was all I did for field options, there would be no problem, but I also had a field validation calculation. It really doesn’t matter what the calculation is, but the whenever there is this combination of both the auto-enter calculation and a field validation calculation, the latter will determine the auto-enter value in certain circumstances and will not use the value determined by the actual auto-enter calculation.
I’ve attached a copy of the file so you can see for yourself.
In the file “NumericGlobalField1” is defined with the aforementioned GetAsNumber (Self) function for the Auto-Enter calc, and has a Field Validation Calculation of 2+2 (and again, this could be any value).
The weird behavior is this: if you enter (any) value into NumericGlobalField1 AND DO NOT YET COMMIT THE RECORD and then go to NumericGlobalField2 but DO NOT ENTER ANYTHING and keep everything uncommitted, and you then go back to NumericGlobalField1 and change the value to something else, it will change the entered value of NumericGlobalField1 to the Field Validation Calculation of 2+2. It looks as if there is a bug where FileMaker conflates the value of the Auto-Enter calc versus the Field Validation calc.
Has anyone else encountered anything like this? Fortunately I can work around this (after all, it’s FileMaker!), but had I not checked this carefully, it could have resulted in a lot of bizarre query results.
Anyway, apologies for the long post. Best wishes to everyone for a happy, healthy and prosperous 2025.
Peter Gerlings
Temp.fmp12 (228 KB)