Jump to content
Server Maintenance This Week. ×

Repeating fields in FM 9


This topic is 6070 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm a long-time user of Filemaker 7, and I'm curious whether FM 9 has fixed a problem in the way Filemaker treats repeating fields in scripts and lookups.

In FM 7, calculation fields can work with all the repetitions of a field simultaneously. That is, if VectorX and VectorY are both number fields defined as having three repetitions, you can create the calculation field VectorZ=VectorX+VectorY.

But by contrast the repetitions in a repeating number field can't all be changed simultaneously in a script step with Set Field [VectorX; 2*VectorY]. You have to set the individual repetitions separately: Set Field [VectorX[2]; 2*VectorY[2]] etc.

And, what is worse, it's impossible to set the values of a repeating number field using a lookup.

This inconsistency in the way the database treats repeating fields makes calculations a LOT more elegant when using repeating fields. And it makes for a confused developer, as I have to remember while scripting not to try certain things that would work in a calculation.

So I'd be willing to upgrade if I could get an assurance that this problem has been addressed in FM 8 or FM 9.

Link to comment
Share on other sites

I don't know of any changes, except since version 8(?) you can specify the target repetition in Set Field by a calculation.

You can do this in FM 7, too. But if you don't specify a target repetition in a Set Field script step, only the first repetition is set.

I am not sure I agree with that.

If you know how to do it, I'd love to learn how. When I set up a lookup for one repeating field, asking FM to look up the value from a repeating field in a different table, it only sets the first repetition and none of the others. I assume that these problems are related, that the scheme used to set fields in script steps is also used in lookups, and that in both cases it is unable to work with all the values in a repeating field simultaneously.

But if you folks know better, I'm eager to learn.

Link to comment
Share on other sites

No, you can't. In version 7, the repetition to set must be hard-coded into the script set. In later versions, the repetition can be dynamically determined at script runtime by a calculation, e.g. Set Field [ RepeatingField [gCounter] ; "some value" ].

That's not my experience (incl. v.7.0v3). The rules for lookup are a bit different for repeating fields, but if the match fields are NOT repeating fields, a repeating field looks up all repetitions of the source field.

Link to comment
Share on other sites

In version 7, the repetition to set must be hard-coded into the script set. In later versions, the repetition can be dynamically determined at script runtime by a calculation, e.g. Set Field [ RepeatingField [gCounter] ; "some value" ].

Great! That's just what I'd like to be able to do. Thanks!

That's not my experience (incl. v.7.0v3). The rules for lookup are a bit different for repeating fields, but if the match fields are NOT repeating fields, a repeating field looks up all repetitions of the source field.
I stand corrected. Didn't seem to work for me last night, but it worked just fine now.
Link to comment
Share on other sites

This topic is 6070 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.