Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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:

Posted

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.

Posted

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?

Posted

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

Posted

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!

Posted

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:

Posted

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

Posted

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? :(

Posted

http://en.wikipedia.org/wiki/1NF

Posted

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

Posted

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:!!!!

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