12 Replies Latest reply on Jul 11, 2012 2:41 PM by philmodjunk

    Data Separation with Multiple Relationships?

    BillBoyd

      Title

      Data Separation with Multiple Relationships?

      Post

      I'm trying to sort through the posts on separation of logic and data so I can apply them to the Business Productivity Solution - Services Edition.  It has seven different files, nearly twice as many tables, and a lot more table occurrences in relationships.  Can someone confirm my impression that I need to reset the "data source" for every table occurrence in every relationship diagram?  Thanks for any information.

        • 1. Re: Data Separation with Multiple Relationships?
          philmodjunk

          Yes, if you split a file into data and interface copies, you have to reset every table occurrence in the interface copy to point to the correct table in the data copy.

          Convert to Seperation Model

          • 2. Re: Data Separation with Multiple Relationships?
            BillBoyd

            Thanks for the confirmation.

            I read mentions of scripts in the interface files vs. the data files.  I'd expected all scripts to be in the interface files.  Is that automatic in a sense?  Is there anything special I need to do to keep that straight?

            • 3. Re: Data Separation with Multiple Relationships?
              philmodjunk

              There are only two cases, that I can think of where you would include a script in the data file:

              If you have a script that must use the "run with full access privileges" option in order to modify data/delete records, etc, the portion of the script that modifies the data must be located in the data file or it won't be able to use the "Run with full access privileges" setting to bypass the limits imposed by the user's privilege set.

              A script or scripts in the file may be needed to update account/password/privilege settings as part of a scripted system for creating and maintaining identical accounts in both files.

              • 4. Re: Data Separation with Multiple Relationships?
                BillBoyd

                I think I redirected all the table occurrences to the "data" files.  That was tricky.  FileMaker kept wanting to change the name of the table occurrences and, if there were more than one table in the list, to change the selected table.  I copied the name of each table occurrence so that I could paste it back in if FileMaker changed it.

                Is there an easy way to verify if I changed all the table occurrences?  It would take me an hour to open all the table occurrences to check each one.

                Regarding scripts, how can I control whether a script is in the interface file or the data file?  If I have a copy in each, how can I specify which one I want to deal with?  And on the same vein, how can I delete the tables from the interface file?

                This data separation subject seems like it would be essential to a whole class of FileMaker developers.  I'm surprised that FileMaker hasn't taken the time to document it properly.

                • 5. Re: Data Separation with Multiple Relationships?
                  BillBoyd

                  I've answered my own question.  The "Database Design Report" shows the data source of each table occurrence.

                  • 6. Re: Data Separation with Multiple Relationships?
                    philmodjunk

                    Regarding scripts, how can I control whether a script is in the interface file or the data file?  If I have a copy in each, how can I specify which one I want to deal with?  

                    Except for a few special cases, you don't need scripts in the data file. Your layout buttons, triggers etc will all perform scripts in the interface file by default. If you need a script, button or trigger to perform a script in the data file, you'd need to specifically select the data file and select a script from it instead of the interface file.

                    And on the same vein, how can I delete the tables from the interface file?

                    In Manage | Database | tables, select each table and click the delete button.

                    • 7. Re: Data Separation with Multiple Relationships?
                      BillBoyd

                      I understand that I don't need scripts in the data files.  My not-quite-clearly-worded question was how I delete from the data files scripts that were part of the original combined files.  I now have six interface files and six data files.  If I double-click on a data file I get one window for each of the six interface files.  The menu option Scripts > Manage Scripts only shows me scripts in the current interface file.  I don't see any way to select a data file so that I can delete the scripts in it.  It occurs to me that I may be able to move each of the data files to another folder, open it there in hopes that it would open in isolation so that I could delete its scrpts, then move it back to the main folder when I'd finished.  Is that likely to work?

                      • 8. Re: Data Separation with Multiple Relationships?
                        philmodjunk

                        You don't have to delete them to make this work. You can just leave them in the file unused.

                        If I double-click on a data file I get one window for each of the six interface files.

                        I'm afraid that doesn't make much since to me. Where exactly did you double click the file? Why would opening that file open ANY other files?

                        You should be able to find the data file on your computer and open it--either by double clicking or by selecting open from the File menu in fild maker. You can then use the manage | scripts window to select and delete scripts from the data file. They key is that you must have the data file open. If you are getting interface files opening automatically when you open your data file, something odd is going on as this is not necessary for a data separation model. You want the data file to open when you open an interface file, but the reverse is usually not necessary and wont' happen unless some aspect of your data file's design refers to the interface file.

                        If you do have multiple files open--both interface and data--select the data file from your window menu and then you can use manage scripts to delete the scripts.

                        • 9. Re: Data Separation with Multiple Relationships?
                          BillBoyd

                          Apologies for the long delay in replying.  Those six "Business Productivity Solution - Services Edition" files are all interlinked.  Each one has a script that opens all the others.  As a result, if I double-click on "bps__Main_Menu.fmp12" (or any of the others) all six files (12 in the case of split logic and data) open.  Under the Window menu is an entry for each of the six logic files but nothing for the data files.

                          As I mentioned, it occurs to me that I may be able to move each of the"data" files to another location and open each of them.  This might give me a chance to delete the scripts in them.  Once that was done I could move them back to the original folder.

                          • 10. Re: Data Separation with Multiple Relationships?
                            philmodjunk

                            I am not familiar with this solution so I cannot respond in detail from what I see here in this thread, But the obvious method for not getting all these extra files to open is to remove, disable or modify the script that opens them--particularly when you are simply opening the data file. THis may be as simple as opening FileOptions and editing the settings found there that can be used to perform a script when the file opens.

                            • 11. Re: Data Separation with Multiple Relationships?
                              BillBoyd

                              Here's the heart of the "Open All Files" script:

                              if [not(fnlsWebConnection)]
                                Open File [Open hidden: "Contacts"]
                                Open File [Open hidden: "Services"]
                                Open File [Open hidden: "Projects"]
                                Open File [Open hidden: "Email"]
                                Open File [Open hidden: "Service Orders"]
                              End if

                              (Any idea why I can't copy those steps from an "Edit Script" window and paste them into this message instead of the manual typing I needed to do?)

                              I tried what I thought might work.  I copied one of the "data" files out of the folder that contains all 12 files, then opened it.  After several error messages about not being able to find other files, I had the "data" file open by itself with access to its layouts and scripts.  That method should aloow me to delete those things from each "data" file.  Before I try that on the actual files I need to try it on a copy of the system, then do enough testing to convince myself that I haven't broken anything.

                              • 12. Re: Data Separation with Multiple Relationships?
                                philmodjunk

                                For the data file, I'd just open File OPtions and clear the setting there that specifies that the "open all files" script run when the file is opened. You don't need all those files opening automatically just because you opened the data file.