Make sure that the "Do not replace existing value (if any)" box is unchecked as it will prevent the result from recalculating.
You may also want to check the validation options.
An auto-enter calc will not update (re-calculate a value) if the value that changes is from a field in a related table such as Packages in this example. An unstored calculation field would seem your best option unless you need a stored/indexed field. In the latter case, you are better off using a script performed by a script trigger.
And you can simplify your calculation to be:
Count ( Packages::PackageName )
Thanks for both your responses! I did check "Do not replace value" box. And Phil is correct that an unstore calculation field did work but I need it to relate to another table. So it should be indexed. Maybe I can try creating another field to copy data from the Calculation field? By the way, thanks for pointing out a simplified calculation!
Unstored can at times be used as a match field in a relationship. If you have this relationship:
TableA::Field1 = TableB::Field2
Then Field1 can be an unstored calculation field if you need to work with this relationship from the context of TableA--such as using a portal to TableB placed on a TableA layout.
But an alternative is to set up scripts--typically performed by script triggers that update this field each time a change takes place that changes the value of this calculation.
I am trying to get the first of several records using the trick described here: http://help.filemaker.com/app/answers/detail/a_id/9610/~/the-self-join-relationship%3A-what-it-is-and-some-examples-of-how-to-use-it. I need to use PackageList (Calculation field; Substitute(List(Packages_Timesheet::PackageName); "¶"; ";")) as the match field. But it turns out that it only works when I when check off "Do not store calculation results -- recalculate when needed".
Your suggestion to use a script does work; I tried that out. But using a match field makes things easier for me. So I tried creating a different field copying the calculation field (PackageList2; text field; Auto enter =PackageList), but to my surprise, the new field PackageList2 is blank. Could you explain why is that?
I appreciate your help!
IF you add or change an auto-enter calculation, the data in this field will not automatially update for existing records. You have to use Replace Field Contents or the trick described here: Updating values in auto-enter calc fields without using Replace Field Contents
to update the field in existing records.
But you've lost me in:
a) why this can't be an unstored calculation
b) and why/where you are copying this field