Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Set Field - Target -> Repeating fields - How?

Featured Replies

myField - repeating field - 5 repeats.

someField - same type field - no repeats.

loop - global field - number - no repeats.

In a script - when accessing data in a repeating field - I can get to it either by direct reference:

set field(someField, myField-2)

-or-

set field(someField, GetRepetition(myField,2)

-or-

set field(someField, GetRepetition(myField,myLoop).

I can SET Repeating field / repetition:

set field(myField-2,someField)

but how the heck do I:

set field(myField-loop, someField)????? Can you (I) not use a global to set which repeat in an assignment?

Here is what I want to do:

Set Error Capture [ On ]

Loop

Set Field [ Main::Loop, Main::Loop+1 ]

Enter Find Mode

Set Field [ Invoices::Contact ID, Main::contID ]

Set Field [ Product ID, GetRepetition(Main::Prods, Main::Loop) ]

Perform Find [ Replace Found Set ]

If [ Status(CurrentError) = 0 ]

Set Field [ Main::Tots-Loop, ItemSum ]

End If

Exit Loop If [ Main::Loop = Count(Main::Prods) ]

End Loop

Set Error Capture [ Off ]

It's that Set Field inside the IF where I want to set which Main::Tots (which - like Main::Prods) - is a 24 deep repeating field.

I'd like to use Main::Tots as an array... assigning the "repeat" dynamically - but I can't figure how. Any suggestions greatly appreciated!!!!!

TIA!

Nope, the destination repetition has to be hard coded in the set field step, unless they've changed this in version 7.

  • Author

Ouch. Well - y'all had some great code for dealing with dates - I'd hoped for similar magic this time - however - I can deal with it. *Now* I see a use for Exit script - since we don't know how many products the user will have in the list (1-24) when I reach whatever number it is - bail out of the "hard coded" chain of 24 steps...

At least now I know what to do (and stop looking for what I'd missed) - so it's off to see the Blue Angels doing their thing in the wild blue this afternoon - nice diversion!

Thanks for your help!!! --just knowing I hadn't "missed" something obvious truly is a great help - has anyone noticed F/M's documentation sucks?

One workaround is to go to a layout that has only the repeating field on it and then execute a looping script that repeatedly goes to the next field and then exits if the current repetition number is equal to the target repetition. Then you can use the insert calculated result step to set the value. Ugly, but it works.

  • Author

Thanks - but actually - I found that just using 24

if(GetRepetition(myField,1)>"")

{find / sum / assign)

end if

(then after 24th IF)

some tiddying-up code

end of script

works just fine - as you say - ugly - but it works.

No offense - but I've found that F/M just isn't up to what I need in a db. 4D is suffering severely from "bloat" - F/M just hasn't got the juice - so I guess it's time to get serious about looking into Servoy or such. I did commit on this one project to add graphing and clean up some issues on an existing db for a customer - and do it in F/M. I *will* keep that commitment - but do I ever miss a few "vitals" - like arrays, real variables, scripts that aren't tied to anything (layouts) AND have universal "reach" - and most of all - schema that can be updated without worry about/with the data. F/M 7 is a step in the right direction (all tables in a single file) - they just need to take the next step.

Again THANKS for your help and suggestions - keeps me from making a (total) fool of myself!!!!

Lack of arrays is definitely drawback, but many people still develop sophisticated databases in Filemaker and live worthwhile lives.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.