9 Replies Latest reply on Dec 30, 2010 8:04 AM by DieHardNewbie

    Why FMP Auto-Creating Records When Other Record Created?

    DieHardNewbie

      Title

      Why FMP Auto-Creating Records When Other Record Created?

      Post

      I'm relatively new to FMPro. Using v11 to take our fleet of Excel.xlsx's to the next level. Here's the problem: I have a table I store just Global Variables in. I don't know why but whenever I create a record in it, it creates a record in a different table. If I delete a record in it, it deletes it in another table. My Global Variables table only needs one record. I'm not sure how all these got made in the first place or how this weird relationship started. I am using the file off my desktop and just saved it there from the network. Anyone out there know what is going on?

        • 1. Re: Why FMP Auto-Creating Records When Other Record Created?
          philmodjunk

          Not without knowing more about your database design.

          A triggered script might be doing this. You might be entering data in a field to the related table when you thought it was a field in the Globals table. Other explanations are possible.

          Describe any relationships you have linking your Globals table to the table where you are seeing this record related.

          GlobalsTable::fieldName = RelatedTableName::FieldName

          Is a simple way to document that.

          Then make a detailed step by step description of what you are doing to "create a record" or to delete it.

          • 2. Re: Why FMP Auto-Creating Records When Other Record Created?
            DieHardNewbie

            the "Global_Variables" table only interacts with the "Productions" table when I am going to book equipment for a "production". I store the PRoductions ID, start time, and end time into the Global_Variables fields to store them while I move to the unrelated "Equipment" table to book equipment for the production.  Does that make sense?

            • 3. Re: Why FMP Auto-Creating Records When Other Record Created?
              philmodjunk

              It doesn't list your existing relationships nor do you list the exact steps you are taking when you create a record in Globals and a record in the related table (Productions?) is also created.

              (and I think your equipment table probably shouldn't be "unrelated" either, but that's a different issue.)

              • 4. Re: Why FMP Auto-Creating Records When Other Record Created?
                DieHardNewbie

                the only steps I'm doing is clicking the '+' record line in a table-view layout of the Productions table and it is automatically creating a new Global_Variables table record. 

                It was never doing this before. All that happened was I opened my file for a days work and noticed that the Global Variables table had one record for each Production record. The day before, it only had one.

                I have no idea what to do. 

                Also, if I change one field in the Global Variables table, it changes it for all the other records in the table. So, all 21 records always have the same exact values in each field. 

                Help?

                • 5. Re: Why FMP Auto-Creating Records When Other Record Created?
                  philmodjunk

                  Clicking the plus sign on lower left (not the one on the right in FileMaker 11 that adds a new field) will automatically create a new record in the table on which the current layout is based. That's how it is intended to work. It's the equivalent of selecting New Record from the Records Menu or pressing it's keyboard shortcut.

                  Since the fields have global storage defined, all records will show the same values at all times. If you want each record to contain different values in the same field, you'll need to remove the global storage field opton for that field.

                  • 6. Re: Why FMP Auto-Creating Records When Other Record Created?
                    DieHardNewbie

                    I understand that clicking that will "automatically create a new record in the table or which the current layout is based." But when I create that specific new record in the "Productions" layout (by clicking that "+"), it automatically created a new record in the Global's layout. I have two windows open (4 actually) on a large monitor so I can see different table views being acted on in my program. When I add (or delete) a record from either view or table, it does it in the other one as well. They are based on different tables without any parent/child or one-to-many relationship. 

                    Hope this helps to clarify what i have going on. Thanks for your help so far and for any other help you can offer!

                    • 7. Re: Why FMP Auto-Creating Records When Other Record Created?
                      philmodjunk

                      That only happens if both layouts refer to the same data source table or you might have a script trigger set on the layout with OnRecordLoad that creates the new related record for you, but I find that unlikely given what you describe.

                      Enter layout mode on each layout and select Layout Setup....

                      What table occurrence name is listed in "Show Records From"?

                      If different names are listed, open Manage | Database | Relationships and double click each of the boxes with the same name as you found in layout setup. I predict that you'll find that both refer to the same data source table.

                      Note: Data source tables are the tables listed in Manage | Database | Tables, while Table Occurrences are the "boxes" found in Manage | Database | Relationships. While they may have exactly the same name, they aren't the same thing in FileMaker. See this thread for more about table occurrences:  Tutorial: What are Table Occurrences?

                      • 8. Re: Why FMP Auto-Creating Records When Other Record Created?
                        DieHardNewbie

                        I did as you said, but they are both referring to different data source tables. To make this all more interesting, when I opened my file yesterday, to show the problem to someone else, it was gone. the 'Global Variables' table only has on record now and if I created a new production, it didn't make a new on in the Global Variables table. 

                        At first, when I made a copy of our small fledgling database from the network to my desktop, it had the error. Most recently, I only opened the network version. Yesterday, I saved a copy to my desktop and the problem wasn't there. It just appears randomly and unpredictably. 

                        I'm probably going to just keep plugging away on my scripts and layouts as if there is no problem. I don't understand caching very well, but maybe it is a little caching bug in FMP ?

                        • 9. Re: Why FMP Auto-Creating Records When Other Record Created?
                          DieHardNewbie

                          Hey, I just realized I was mistaking two Global Variables table layouts. One, like you said, was showing records from "Productions". The other, was showing records from 'Global Variables'. I thought opening it from different locations caused some weird caching bug, when actually, I was just opening different (though very similarly named) layouts. 

                          User error the whole time. You were right! Thanks for helping an idiot (all the time I wasted!).