April 20, 200619 yr In Filemaker 7, is it possible to construct a function that will work like the Set Field script step but allows you to set the Nth repetition of a repeating field, where N is a value from another field or a calculation? For example the function might be Set FieldRep(repField;index;newValue) where repField is the repeating field, index is a number which points to the required repatition, and newvalue is the value to insert in the required repetition) The only way I have been able to mange this so far is to go to a layout where the variable is displayed, get the value I want to enter in the repetition into the clipboard, use a looping script to skip down the repetitions until I get to the one I want and then paste. A bit clunky... Any help or suggestions greatly appreciated. Brian Rich ruralnet|uk
April 20, 200619 yr Functions do not set fields. Functions are used in calculations, were they return a result calulated from the function's parameters. It doesn't matter how you calculate your index (N). Custom function or not, the Set Field[] step in version 7 will not accept a calculated result to specify the repetition to set. You might want to consider upgrading to version 8, where this is possible. Or change your structure and use related records instead of repeating fields.
April 20, 200619 yr Author Thanks for that information. I was aware that this could be done with Filemaker 8, it's just that we probably won't get there for a while yet. -(
Create an account or sign in to comment