If you're willing to do without a script altogether, wouldn't the Count() function be of good use here?
Set up a field called "Count" as a calculation and define it as
or did I misunderstand what you are trying to do?
Well, I do have a field that is actually counting the value (dupcounter is a calculated field that does a Count( Estimate 2::estimate_parent_id), and that is working properly (I see the value increase each time I create a dup). The issue is, when I create a new duplicate, only the NEW record is getting that field populated with the correct count. I want to make sure that field gets updated for all related records. I thought if it was a calculated field it would auto update the others, but that does not seem to be the case.
Can't use a global (I don't think) because that field is not the same for all records, so I'm guessing I just need to update that field for all related records.
I'm just having issues finding the correct scripting steps that do that.
have you checked the checkbox by "do not store" under the storage options of your calculated field? It should be unstored.
Adding on: I don't think I've seen anything that you've posted in this thread that calls for a script. If this is simply a selfjoined table, you don't need a script, just the count field...I just tried this out on one of my play dbases and it works like you want it to...as long as the "do not store" is checked.
Hmm, is that an option for Filemaker 10 Advanced? I am looking at the storage options and do not see that anywhere.....
**Silly me, had the field set as a numeric and not a calculation. The check box was already checked for do not store tho....I'll test again.
Yes, seems to be working as I need it. A simpler solution is always a better one!