Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

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 smile.gif

Posted

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"

)

Posted

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 ... )

Posted

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

Posted

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 !! smile.gif

Posted

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

This topic is 7357 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.