10 Replies Latest reply on Nov 15, 2008 3:13 PM by obeechi

    Create 2 records

    bptravis

      Title

      Create 2 records

      Post

      Hello. I'm not used to working with Filemaker, so bear with me. I have two databases and I need to insert data into the one when a new record is created in another. So if database 1 creates a new record, I need that record also inserted into database 2. Sounds easy but I can't figure it out in Filemaker 9. 

      Thanks 

        • 1. Re: Create 2 records
          TSGal

          bptravis:

           

          Thank you for your post.

           

          I'm assuming you have two tables linked together.  When you manage the relationship, make sure you have the options checked for "Allow creation of records in this table via this relationship".  This allows you to add records to the related table.

           

          Create a portal on your layout into the other file.  When you add information to the current file, you can add the additional information into the portal, which is also a new record.

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Create 2 records
            bptravis
               Thanks. Let me change the scenario a bit. I have one database file with two tables. Table 1 has some data (first name for instance) and table 2 has some data (another first name field for instance). If someone updates the first name field in table 1, I want that change to take place in table 2 as well. I think this can be accomplished through relationships somehow, but I'm not sure. Thanks. 
            • 3. Re: Create 2 records
              TSGal

              bptravis:

               

              Thank you for the clarification.

               

              Do you need the name in both tables?  If you have a relationship set up based upon some "key" field, you can display information from either table.  Therefore, you can display the name in the related file, or the name in the current file.  That is, you just have one instance.

               

              To set up a relationship, go to Manage -> Database...

               

              Click the Relationship tab, and you will see a graphical representation of your tables.  Determine what is going to link the two tables together, and drag that field from one table to the other field in the second table.  The line between the two tables shows that the files are now related.

               

              In Layout Mode, you can attach the fields you want in the related table to display in the current table.  If you type a value into the key field, then the information from the related table will display.

               

              If you need additional information or need clarification, please let me know.

               

              TSGal

              FileMaker, Inc. 

              • 4. Re: Create 2 records
                bptravis
                   Well now the situation has changed again. I need a script that will activate when a user exits a field. The script checks the edited field against the same field in another table and if there is a difference, make the change so they are the same. I need to do this without using portal fields. Thanks. 
                • 5. Re: Create 2 records
                  raybaudi
                    

                  The situation is always the same.

                   

                  As TSGal said you, there is no need to have two fields holding the same information.

                   

                  You can put the field of the second table directly into the layout that shows the fields of the first table ( if those tables are related or if that field is a global one )

                  • 6. Re: Create 2 records
                    bptravis
                       Thanks but I'm still not getting it. I am very new to Filemaker so that may be why. From what I gather from your solution, it sounds like the use of a portal field displaying records from another related table. I can't use portal fields because of other factors in our database. This is why the only solution I see at this point is to use a script to check to see if fields match. I know this is confusing, but any suggestion helps at this point.
                    • 7. Re: Create 2 records
                      scottm
                        

                      I am fairly new to FMP as well, but I found a book that answered a lot of these types of questions and really helped me to think in a "database" mindset instead of an Excel table point of view.  Take a look at Amazon or Idigo for:

                       

                      Filemaker Pro 9:  The Missing Manual

                      by: Geoff Coffey & Susan Prosser

                      • 8. Re: Create 2 records
                        bptravis
                           Thanks for the tip. Still having problems though. All I need is a calculation field or script that will run when a button is pressed that checks the same field in two different tables. If the records are different, change them to be the same. Like I said earlier, I can't use portal fields due to other ways our base is setup in areas. If you need more info just let me know. Thanks.
                        • 9. Re: Create 2 records
                          raybaudi
                            

                          I can't imagine why those tables can't be related and why you must have the same field in two tables.

                           

                          From the last your message it seems that the two tables have common values, not only for the same field, but also for the same record. IOW the two tables are identical ( or such ) at least in the total record number.

                           

                          Can you say more about those tables ?

                          • 10. Re: Create 2 records
                            obeechi
                              

                            If one table, the parent table, has a field, like "name", and another table's layout, the child table's layout, has a field like "the-same-exact-name", then the child table's layout can simply display the "name" field that belongs to the parent table. This is not a portal, its the reverse, it shows only one record for the field. A portal would be viewing many records in the parent table's layout that originate in the child layout. A parent table record is related to many child tables records. 

                             

                            Do you have many records in one table related to one record in the other table? Or, do you have one record related to one record, and if this is the case, does a given name occur only once in each table or does it appear more than once in each table? If the latter, then is it possible that you really need three tables, where one table holds the name, and the two other table's layouts display the name that originates in the this parent table?

                             

                            Your goal is to be able to type the same name only once, and have it appear everywhere else it is needed without retyping.