November 26, 200421 yr I have a repeating field.. with 5 repetitions. I want to make a script which, using a script parameter, will operate on each repetition of the repeating field. the script will simple insert a date if the field is empty for that repetition.. How can I do this ?? thanks
November 26, 200421 yr You can also use the Get ( CalculationRepetitionNumber ) function to act on repeating fields in a calculation. Case( Get ( CalculationRepetitionNumber ) = 1; "Result 1"; Get ( CalculationRepetitionNumber ) = 2; "Result 2"; Get ( CalculationRepetitionNumber ) = 3; "Result 3"; Get ( CalculationRepetitionNumber ) = 4; "Result 4"; Get ( CalculationRepetitionNumber ) = 5; "Result 5" )
November 27, 200421 yr To simplify the script, you can use IsEmpty(Get(ActiveFieldContents)) instead of IsEmpty(GetRepetition( pling::theRep; Get(ActiveRepetitionNumber) )), since the cursor is already in the field. You can also simplify Michael's suggestion by using Choose( Get(CalculationRepetitionNumber) - 1; result1; result2; result3 ... )
November 28, 200421 yr To simplify the script, you can use IsEmpty(Get(ActiveFieldContents)) instead of IsEmpty(GetRepetition( pling::theRep; Get(ActiveRepetitionNumber) )), since the cursor is already in the field. You're right - but repeaters are still heracy in my book - Thanks for the input!! --sd
November 29, 200421 yr Author Is a portal really a better way to go when you know that there will never be more than a few entries into that field ? Seems like a portal might be overkill... but I'm still very new to Filemaker... please enlighten me !!
November 29, 200421 yr Well, this is a question that can't be answered easily - but a good rule of thumb is if you ever are going to make any sort of statistics on the values, are relations better. But if the requirement is to search in the field from the actual layout is repeaters faster due to indexing. To make a judgement in your particular case, must a description of what the purpose of the scripting really is be know to us. Giving advise on repeaters is kind of giving brandy to an alcoholic, and I wan't least of all keep up an appearance that the bigger picture doesn't exist. Context matters and I'd dare to say that repeaters only should be used for special purposes - not a strong argument, but several expiriences of getting into deep, when trying get something serious out of data stored in repeaters. So pease let me now, what the purpose is with the scripting... --sd
Create an account or sign in to comment