AnsweredAssumed Answered

Custom functions do not load - why?

Question asked by dburnham on Feb 9, 2015
Latest reply on Feb 10, 2015 by DavidJondreau

I have a database that uses a dozen or more custom functions.  All of them are defined to be available to all accounts.

There is an un-stored calculation field in the database that uses an equation such as this:     cost + fee +  CustomFunction.

My customer and I are both using FileMaker Advanced 13.  He doesn't know about custom functions and the only reason I mention that he uses FileMaker Advanced 13 is because that's to dismiss the notion that different FileMaker versions are the cause of what we are experiencing.

 

When I look at the un-stored calculation field, I see the result of  cost + fee + CustomFunction.

When he looks a the same record on the same layout he sees the result of only cost + fee.    Custom Function is being ignored.

 

To troubleshoot this, I launched FileMaker 12 (not Advanced) and went to the suspect record on the suspect layout and indeed, I was viewing exactly what my customer viewed.  The incorrect result was ignoring the value that should have been given by the custom function.  In other words, the custom function did not load.

 

Then, I created a new field called "test" and defined it to be the result of only the Custom Function and specified it to be un-stored.   I then placed that new field on the same layout and the correct result suddenly appeared in both fields.  The new test field displayed the value of the custom function and the suspect field also displayed its correct sum of cost + fee + Custom Function.  I don't know what triggered the correct recalculation of the field that uses the custom function.  Was it that I defined a new field that called the custom function, or was it that I placed it on the layout thereby forcing the result?

 

More important, what's the best way to avoid this?  Create test fields that display the result of all custom functions and place them in the margin area of the layout?  Add some script steps to a script trigger that runs "on record load" ?

Outcomes