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

setting local repeating global field

Featured Replies

Hi,

this script works only for the first of a 99 item repeating global field. The field A is a local field with 99 repetitions. I'm trying to get 99 values from a repeating global field named "A" to change the values of a global field with 99 repeating values named "B".

set field [filename::( global;filename::a]

Data is the following:

value of repetition 1 of field A :B papa

Value of repetition 2 of field A :B quebec

value of repetition 3 of field A : romeo

etc.

value of repetition 1 of field B ( global ): blank ( all are blanck )

After running the script the result is the following :

Value of repetition 1 field B : papa

Value of repetition 2 field B : blank ( all the rest is blank)

If I go another route, (just below), I get all blanks.

set field [filename:B) global[99];getRepetition(filename::a;99)]

What am I missing?

Thanks

Cheers

Loop

Set Variable [ $rep ; Value: $rep + 1 ]

Go to Field [ filename::( global[ $rep ] ]

Exit Loop If [ Get ( LastError ) = 102 ]

Set Field [ [color:red]no field here ; filename::a[ $rep ] ]

End Loop

  • Author

Thanks,

I'll try it out and will let you know the result.

Cheers

  • Author

Great!

Works like a charm :( thank you so much! :party::yourock:

Just curious ( that's my name!) B) why 102 instead of 99 for the lasterror command?

Cheers

Next question is if you really should need the tip for anything at all? Perhaps it might fall exactly here:

http://fmforums.com/forum/showpost.php?post/149069/

Where it's said:

You don't need to prepopulate the portal and you don't need a script. What you need is an X relation to the "template" records then a second relation to the actual test results. See attached.

--sd

  • Author

Hi Soren Dyhr,

I had a look at the solution and indeed, it's powerfull and light in design.

In this case, raybaudi's solution is perfect as it solved my issue. this being a pet project, I will leave it at that. However, I've suscribed to your solution. That way, I'll be able to dig into it if I need to.

You all have a great one, I've always had the chance to get great help and advice thanks to each and everyone of you. I'me very grateful. You're part of my family now!

Cheers! :beertime:

Just curious ( that's my name!) :( why 102 instead of 99 for the lasterror command?

Error 102 is: "Field is missing"

If you look at "FileMaker Pro error codes" into Help On Line you'll find no Error 99.

  • Author

Thanks raybaudi,

You really rock!

Cheers :waytogo:

ps, as I am adding this icon, makes me wonder if there is a way to import those icons into filemaker? I just tried to import it as an object into a multimedia field but it crashed my filemaker pro 9...any suggestions?

In this case, raybaudi's solution is perfect as it solved my issue.

Scorched earth, could indeed be a strategy - but not necessarily something to make a habit of, when turning back to peace times - you're then regarded arsonist. But ...horses for courses.

It's however a problem that repeating fields are breaking 1NF - Which means that there could be a point in refraining from their use as storage of raw data, and instead only use them as calc'fields only - and how are calc'fields reacting on scripting - well not directly.

--sd

  • Author

Sorry,

You lost me there! My mother tongue is french...your answer is way too abstract for me.

Whatever it means, I'm certain it's well intended.

Hence thanks

Cheers!

It's however a problem that repeating fields are breaking 1NF -

Ahem ...

99 values from a repeating global field named "A" to change the values of a global field with 99 repeating values named "B".

What makes you think it holds regular data, Søren? If it does, it won't stick for lONG! Globals don't store data.

Hey Curious99, Søren IS well-meaning but he SOMETIMES can get a bit out there. You are wise to just take it in. Months (sometimes years) later, his words might come back to you and they will fill in some strange hole in your understanding. And then again, sometimes not. :king:

  • Author

Hi LaRetta,

Great as I love philosophy and indeed most of the time it does take a while to grasp delightful messages within statements.

In any case, like I said, this is a pet project. Being globals, I indeed have this script run at every opening of that database.

Cheers to all

Ahhhh hah!!!!!! See Søren! Those fields do not store long-term perm data but rather they are for Developer use, which is a perfectly solid reason for using repeating fields. You jumped onto the non-normalized 1NF ship prematurely, huh? :(

  • Author

Hi LaRetta,

What's a 1NF anyways?

Cheers

You jumped onto the non-normalized 1NF ship prematurely, huh?

Perhaps but one of the things normalization as such, set out to solve is to prevent syncronization issues - why is there something that gets out of sync, why has anything to be moved into a global where it suddenly gets a wider scope than the actual use, all globals can be accidentally changed because they can be reached without context. Such vulnerability needs a defence.

I just wish to point out that the threads topic by and large neglect two of these 3 issues that:

Database normalization is a formal process of designing your database to eliminate redundant data, utilize space efficiently and reduce update errors.

...namely by being inefficient in space utilisation and prone to update errors, no matter how much it's for the developers eyes only.

--sd

  • Author

Wooooow!

I just looked at the transaltion of "scorched" and indeed this thread is getting to smell like it! There is no lightening smilies but this one might do :joust: !

I fully agree with you Soren, this is the way to go. After having browsed at the link supplied by mr Vodka ( :thanks: ) about 1NF, your point is indeed valid and well taken.

However, being a pet project and not having enough time to get my hands into it at this point, like I said, I'll keep it as is. Again, thank you to raybaudi.

I learned a lot from this post, philosophically (correct spelling?...again, my mother tongue is french) and programming wise.

Merci à tous!

Cheers

Now back to work :cofeebrake:!!!!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.