Jump to content

Copying content of a repeating field into another repeating field


 Share

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

Recommended Posts

  • Newbies

Hi,

I want to copy the content of all the repetitions of a repeating field into a repeating field from another table. Can this be done with a simple script step or do I have to use 14 instances (one for each repetition) of the "Set Field" script step?

Edited by Guest
Link to comment
Share on other sites

Provided that the two tables are related, which is pretty self-contradictionary - could this be done:

Set Variable [ $which; Value:1 ] 

Loop 

       Set Field [ Untitled2::Rep2[$which]; Untitled::rep1[$which] ]

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

       Exit Loop If [ $which=14 ] 

End Loop 



Although the relation could be a cartesian. Otherwise must it be done this way:




Set Variable [ $i; Value:1 ] 

Loop 

       Set Variable [ $what[$i]; Value:Untitled::rep1[$i] ] 

       Exit Loop If [ $i = 14 ] 

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

End Loop 

Go to Layout [ “Untitled2” (Untitled2) ] 

Loop 

      Set Field [ Untitled2::Rep2[$i]; $what[$i] ] 

      Exit Loop If [ $i = 1 ] 

      Set Variable [ $i; Value:$i-1 ] 

End Loop 

But due to the obvious syncking issues shouldn't you rely on solutions using this. Ditch repeaters you can live perfectly well without them, you're violating both 1NF and 2NF - so better have very good arguments ready for doing so!!!

--sd

Link to comment
Share on other sites

Hi,

I want to copy the content of all the repetitions of a repeating field into a repeating field from another table.

Why? It is highly likely that you will be better off spending your time getting rid of the repeating fields and using the relational features of FileMaker.
Link to comment
Share on other sites

This topic is 5741 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
 Share

×
×
  • Create New...

Important Information

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