14 Replies Latest reply on Jan 5, 2010 1:28 PM by Pichi

    another one with copy filed repetition problems!

    Pichi

      Title

      another one with copy filed repetition problems!

      Post

      Hi!

       

      I spend all day long looking for some answers to my db problem, can some one help me?

       

      I almost done my invoice program, but i have a HUGE problem, I have a table A with one field with 34 repetitions I need to copy all data to another table and field B, I tryed but just copy the first one, i read some script but no one work with me some times don`t  copy nothing another times crash the FM

       

      any idea or help? 

       

      by the way Im newbie

        • 1. Re: another one with copy filed repetition problems!
          RickWhitelaw
            

          Unless you're prepared to write calculations dealing with Repetitions, and you can but it's doubtful if it's worth it, don't use a repeating field in this situation. It sounds to me that your "repetitions" should actually be "records" that consist of one field. Although there are situations where repeating fields can be useful, they're a bit "seductive" to some users at first glance (it seems you can have all this data handled by just one field), and the concept gets mis-used. I can't say for sure, but it seems like this is the problem.

           

          RW 

          • 2. Re: another one with copy filed repetition problems!
            Pichi
              

            Hi Rick:

             

            I found this bd from some fm page and I use, and all my information is made on this way, yes the "description" field have 34 repetitions each one for my item for sale,  i found here this script

             

            Go To Layout [ FirstTableLayout ]
            Set Variable [ $var ; List ( RepeatingField1 ) ]
            Go To Layout [ SecondTableLayout ]
            Loop
            Set Varable [ $rep ; $rep + 1 ]
            Set Field [ RepeatingField2[ $rep ] ; GetValue ( $var ; $rep ) ]
            Exit Loop If [ ValueCount ( $var ) = $rep ]
            End Loop

             

             

            but my file crash with this

             

            do you now how to solved my problem?




            • 3. Re: another one with copy filed repetition problems!
              RickWhitelaw
                

              Hi,

               

                I'm not sure what you're trying to do. Perhaps if you try and explain in your own words, giving an example or two, someone can try to help.

               

              RW 

              • 4. Re: another one with copy filed repetition problems!
                Pichi
                  

                Thanks for your reply,  I'm sorry for my bad explain...

                 

                I have 2: tableA and tableB in the same db, in the table A i have 1 field named: description, this field have 34 repetitions (here i put the item inforamation that i'm sold) I need to copy the information of the field description with all the 34 items on the table A to the table B on the field call invoice_description.

                 

                With the copy paste just copy the first item, and i can´t copy the others, i read a lot in the forum and i found a script but doesn't work.

                 

                by the way both fields are related, I don't know if this inforamtion can help, let me go to the mac where i have the file and take some snapshots and put here

                • 5. Re: another one with copy filed repetition problems!
                  Pichi
                    

                  maybe this help:

                   

                  I made my own fm program for my invoices, purchase orders, contact, budget, product information. i have  3 diferente files 1 for the master file, 1 for contact 1 for product, information, i use my master file to call the contact information, and the product information (here should be my table A) from this file i need to send the information to my invoice layout, my job order layout and, my budget layout, and each layout must have a different serial number (of course must be auto enter data).

                   

                  So here in the forum some friend told me that i need to made different layout for each serial number, i made that and i related all the files, my problems is with this field call description, where is the product information, i have a field with 34 repetition (no always use all of them), but when i send the inforamtion to the invoice layout (table B) just copy the first item the other never copy.

                   

                  helps?

                  • 6. Re: another one with copy filed repetition problems!
                    RickWhitelaw
                      

                    Pichi,

                     

                    I'm still lost as to what you're trying to do, but I know that if you're using "copy/paste" on a repeating field FM will copy only the value in the first repetition unless you specify the repetition. There are ways of doing this, but it still seems like an inefficient way of doing the job. From what I can tell, you could have a table "Product Descriptions" that relates to your master table on a one-to-many basis. Each description entry is a record in a single field rather than in one of 34 repetitions of a field. One thing about repeating fields: it's easy to enter data in them, but another story to relate or manipulate that data after it's been entered. It SEEMS like this issue is related to one "corner" of your solution. If, indeed, you've got the rest of it (invoices, purchase orders, budget etc.) working, doing this (new table/separate records) should be fairly easy for you to do.

                     

                    RW 

                    • 7. Re: another one with copy filed repetition problems!
                      Pichi
                        

                      Thanks for your recomendation, i should do that, yes it seems very useless my way to do that, i change all...

                       

                      thanks

                       

                       

                      • 8. Re: another one with copy filed repetition problems!
                        Pichi
                           Hi! one more questions, if i made with lineitem works?
                        • 9. Re: another one with copy filed repetition problems!
                          mrvodka
                             The bigger question is why are you trying to copy this information into another table anyway.
                          • 10. Re: another one with copy filed repetition problems!
                            Pichi
                              

                            hi mr_vodka!

                             

                            It´s simple, i use my program to made my invoices, budget, job order, track order, i used my master file to do all, but i have to use different serial number (all should be auto-enter data), and I made my program with a single table (acctually i got this program from a fm example, the one of the bikes)  but i have to put almost all my serial number to the invoice, budget, job order, track order manually, so here in the forum told me to use tables, ok I got the table relationships and works the serial number perfect but now i solved that and the problem to copy the data from my field with repetitions to the other tables it´s drive my crazy!

                            • 12. Re: another one with copy filed repetition problems!
                              Pichi
                                

                              hi! yes i saw this, acctually i´m redesign all

                               

                              thanks

                              • 13. Re: another one with copy filed repetition problems!
                                mrvodka
                                   The benefit of having a relational database is to reduce the amount of duplicate data and instead reference the data. There are obvious times where you will want to duplicate the data for historical purposes ( such as info on an invoice ) and that is why lookups are used.