7 Replies Latest reply on Mar 24, 2009 2:53 PM by johnhorner

    Keeping track of finds in two tables

    aiconline

      Title

      Keeping track of finds in two tables

      Post

       I have two tables: Log and Use. I keep "old" data in each file and the current data I want to work with. The tables share a common field: LogPlusTerm to relate the two tables.I can do the find for each table to get the records I need to use.

       

      When I switch from one table to the other (using a Go to Layout B command) I "loose" the found set of records in table A - and go to the begining of file A.  How do I get the find to "persist" or remain valid?

        • 1. Re: Keeping track of finds in two tables
          johnhorner
            

          are you sure you have your buttons on each layout programmed to "go to layout" instead of performing another action such as "go to related records" or performing a script?  i tested this on my database and "go to layout" not only preserves the found set, but also returns to the most recently active record within that previously found set.  my database is set up in "anchor bouy" format and i am going back and forth between layouts based on the primary table occurence for each table.  are you sure you don't have any other scripts running to "find all" set up with triggers on layout open or something like that?  i am on filemaker 10 and perhaps earlier versions operate differently but the functionality you are looking for is working for me.  perhaps if you could give a little more information about how your tables are set up?

           

          good luck!

           

          john h.

          • 2. Re: Keeping track of finds in two tables
            aiconline
              

            John,

            This applicaiton is much like an Invoicing application where you have one file with the master invoice data and another file with the invoice detail line item(s). Only I am collecting Log Number (class information for a term/semester) and a list of articles for that class (the detail line(s)).

             

            The first procedure simply presents the master (class) information so the user can select a record. The user then clicks on a "Print this TOC" button which collects the term and Log Number (to be used in a find into the detail data set). Next action is to shift to a layout for the detail data set - and here is where I "loose" my find in the master data set and the record pointer reverts to the first record in the data set.

             

            I am using FileMaker Pro Advanced ver. 9 so I have the debugger tool - a real help.

             

            Thanks for helping me out.

             

            Richard

            • 3. Re: Keeping track of finds in two tables
              johnhorner
                

              hi richard,

               

              are you able to post your file online so that i can download it and take a look?  i am having trouble understanding exactly how your database is set up and what it is you are trying to do.  alternately, if you could explain in a little more detail your situation that would be helpful.  for example, what entity is represented in the master file?  is that a class ins the sens of "math 101"?  what entity is represented by the related table?  is this all the related information for a class, (teacher, classroom, credits, students, etc which are just fields in the related table?  (which, by the way, is probably not how i would recommend structuring the database)).  if so, why would there be more than one related record?  when you say "collecting Log Number.." does that mean you have a portal set up in the master file that displays the related information or are you running some sort of script to select the records?  how is the relationship set up between the master/parent record and the related/child record?  i am assuming that it is a one to many relationship?  what do you mean by "first procedure".  is that a script or simply a navigational step?  if it is a script what is the script?  are there only 2 table occurences in your file and 2 layouts?  i have a feeling that what you want to use is a "go to related record" (gtrr) step instead of a go to layout.  just switching back and forth between the layouts will preserve the found set and active record in the first table independently of the found set and active record in the 2nd table.  but the gtrr step will allow you to click on a portal item and (depending on which options you selct) will take you to a different and display the related records (all the related records that were displayed in the portal) and take you to the specific record within that set that you clicked on in the portal.  i think this is what you are trying to do?  let me know if that helps.  if you are able to post your file, i would be happy to take a look at it and see what i can do.

               

              john h.

              • 4. Re: Keeping track of finds in two tables
                aiconline
                  

                John (and anyone else that wants to jump in - I know you've read the posts!),

                Client does not want file/data disclosed; so we have to work with a description.

                 

                Yes, Master file contains information about classes (such as Math 101), Instructor name, class name, term (Fall, Winter,Spring,Summer) and Log Number. Log numbers get repeated each term; combination of Log number and term uniquely defines one record in Master file. There are now two term's worth of data in the file.

                 

                Detail file contains Log number and term as key and contains information about articles (or sections of a book(s)) that instructor wants students to read. There can be one or more detail records per Log number. Again, file grows with each term's data being added.

                 

                What I am trying to do is print a Table of Contents. This has class name, instructor name and term at the top (drawn from master file) and then an entry for each of the detail records specific to that class/term combination.

                 

                User selects menu option to print Table of Contents. A script attached to that menu option does a find for the current term and displays master records (in a table view form) so the user can select which Contents to print.

                 

                A second script takes over when the user has clicked to select Log 9 - Global Studies (Spring) and clicks to Print Table of Contents. This second script stores "9" and term (Spring) to local variables and then shifts to a layout for the detail data set to do a find (find all the detail records for this log and term combination).

                 

                As soon as the Go to Layout step is performed, the record pointer into the master file no longer points to Log 9 - Global Studies, but instead points to the first record in the file (Chinese 143, Log 1, Winter). I know this because I am watching field values as I step through the script.

                 

                Obviously, when it prints the course name is Chinese 143, and the detail records are for Global Studies.

                 

                This is not done with portals but with table view layouts.

                • 5. Re: Keeping track of finds in two tables
                  johnhorner
                    

                  hi richard,

                   

                  sorry to be so long in responding.  i was away for several days.  anyway, i made a simple demo file to show you how i was able to click on a button for a given class and see all the related articles without losing my sort or my place in the sort.  it is a little difficult to understand your situation simply from your description so hopefully this is close to your situation. also, if you are worried about the privacy of your clients data, you can very easiily make a clone of your file that contains no records or information.  this would be very useful in trying to assist you. you can download the demo file i made by using the following link:

                   

                  http://johnhornerphotography.com/TEMP/

                   

                  please let me know if this is helpful or if it is not quite what you are looking for and i would be happy to continue to try and help.

                   

                  john h.

                  • 6. Re: Keeping track of finds in two tables
                    aiconline
                       <!-- [if gte mso 9]><xml> <w:WordDocument>   <w:View>Normal</w:View>   <w:Zoom>0</w:Zoom>   <w:PunctuationKerning/>   <w:ValidateAgainstSchemas/>   <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>   <w:IgnoreMixedContent>false</w:IgnoreMixedContent>   <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>   <w:Compatibility>    <w:BreakWrappedTables/>    <w:SnapToGridInCell/>    <w:WrapTextWithPunct/>    <w:UseAsianBreakRules/>    <w:DontGrowAutofit/>   </w:Compatibility>   <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif] --><!-- [if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif] --><!-- /* Font Definitions */ @font-face      {font-family:Tahoma;      panose-1:2 11 6 4 3 5 4 4 2 4;      mso-font-charset:0;      mso-generic-font-family:swiss;      mso-font-pitch:variable;      mso-font-signature:1627421319 -2147483648 8 0 66047 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal      {mso-style-parent:"";      margin:0in;      margin-bottom:.0001pt;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:Tahoma;      mso-fareast-font-family:"Times New Roman";} @page Section1      {size:595.0pt 841.0pt;      margin:1.0in 1.1in .5in 1.0in;      mso-header-margin:.5in;      mso-footer-margin:.5in;      mso-paper-source:0;} div.Section1      {page:Section1;} --><!-- [if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable      {mso-style-name:"Table Normal";      mso-tstyle-rowband-size:0;      mso-tstyle-colband-size:0;      mso-style-noshow:yes;      mso-style-parent:"";      mso-padding-alt:0in 5.4pt 0in 5.4pt;      mso-para-margin:0in;      mso-para-margin-bottom:.0001pt;      mso-pagination:widow-orphan;      font-size:10.0pt;      font-family:"Times New Roman";      mso-ansi-language:#0400;      mso-fareast-language:#0400;      mso-bidi-language:#0400;} </style> <![endif] -->

                    John,

                     

                    Thank you for your effort on my behalf. Your sample database seems to capture the basic idea – and the problem. You have a ID field that contains a unique value, but FileMaker does not know that. So you get a many-to-many relationship in the graph view of the database ( crowsfeet on each end of the link line).

                     

                    Somehow, in my application, that many-to-many allowed not only the “correct” references (Math :: Fall) but also the values from Math::Spring (to use your example). Then, to compound the whole problem, I had two instances of the “Classes” table as required by the relationship graph. I got all confused over which instance of Classes to use in which context.

                     

                    So, what I did was adjust the relationship graph so I did not need the second table instance. I also set the key value to be unique (and “not blank” just for good measure) which changed the crowsfoot to a single line on the graph. Now I get just the references I want (i.e. Math:: Fall).

                     

                    Again, thanks for your help.

                     

                    Richard

                    • 7. Re: Keeping track of finds in two tables
                      johnhorner
                        

                      hi richard,

                       

                      i'm glad that was helpful.  you are probably already aware of this but just in case you weren't i thought i would mention it.  if you have an article that is used over and over from semester to semester (math_spring and math_fall, for example) or if the same article is used by more than one class (math and science, for example) you don't need to enter the same article multiple times.  you can just use the carriage return to enter multiple class id's and the same article will appear in the syllabus for all of the classes that are listed in it's key field.

                       

                      all the best,

                       

                      john h.