jhotz Posted August 14, 2009 Posted August 14, 2009 Just recently, I now have a problem with my database where the found set will revert to all the records when I close it and open it back up again. The weird part is that the last time I worked on the database it was not doing this. I've tried to retrace my steps (e.g. undoing some things I added today), and checked everything I can think of (e.g. I disabled the startup script), and nothing seems to help. Here's an overview of the database: - It stores the title, composer, lyrics, etc. to music that are sung at church services, so that the music committee can search the text, keep track of what has been sung, etc. - There is a menu view that launches the other screens used for viewing/updating the music, displaying a report for printing, etc. - It's basically a single table for the music, with some related tables for performance data and meta data. - Currently, there are relationships that use an "_constant" field to relate some configuration tables to the "main" table. I had changed this after reading some posts here about the "x" relationship (very helpful!), but I put back the old relationship thinking that might have caused the problem. The basic workflow for the software is to open the database (which will default to the menu view), click the "Music Library" button, enter some dates in the future for performances, click the Monthly Printout button, and print that screen which can be given to the church attendees. But, what's happening is that after you reduce the found set, you click the Monthly Printout button and it's displaying all the records on that screen. I even simplified it by just opening/closing from the Music Library view, but it always displays all the records when it's re-opened. Occasionally it seems to work (i.e. keeping the found set), but then it starts reverting again. I'm hoping someone is able to see something that I can't see, or figure out what I did to cause this. I searched around on the forum, but didn't see anything that was like my problem. Jonathan musicdatabase.fp7.zip
RodM Posted August 15, 2009 Posted August 15, 2009 Hard to tell.. I looked at your code a bit.. tried a search on xxx and found nothing (which is correct)...When returning showed No titles.. so there is a Showall required coming back/ I am sort of newbie too.. but found it helpful to slow down, and get into the Debug window, set the View on, and have my data base open on the side too.. I use the GETFunctions, al the time, I set a bunch of those to the viewer window.. to monitor along the way.. ie. Foundcount, errors, etc.. I learned alot whats happening.. and used the viewer Add+ option to add several items to follow or track, or preview.. I copy or paste code into the Viewer .. Using the 'Evaluate' button suspected code I did not understand.. I learn whats happening to my code/ by playing alot.. (also learning how weird thinking FM is compared to what i new b4) Set script debugger, viewer, sometimes press the -> to continue until it comes a breakpoint you can set to pause at somewhere in your suspected code. Learn to monitoring various field, calc, $vars and basically follow your code 1 step at a time.. Hope that helps, does that make sense.. or maybe you know this already?
jhotz Posted August 17, 2009 Author Posted August 17, 2009 Thanks for the tips, mastar. The scripts I use are pretty simple, and for this problem the debugger didn't do much for me. However, I used the Data Viewer, and found out some more information: - There is a field in the "music" table called "_found" that displays a text string of the # of found records out of the total records (e.g. Record 1 of 2) as a friendlier view than the "rolodex" area on the left side of the window. I used this field to track what was changing as I changed layouts. - On the Music List view, I omit one of the two records so that the _found value is "...1 of 1". - When I switch to the Menu layout (from the Music List layout), the "_found" value changes to "...1 of 2", and this layout is associated with the "menu" table. Something similar happens when I switch to some of the non-displaying (at least in the final version they won't display) layouts which are associated with other tables, but for these it changes to "...0 of 0". In my sample workflow that I mentioned, after finding the set of music for the next month, the user goes back to the Menu window and clicks the Monthly Printout button. This creates a new window, which according to the FMP docs creates a new window with the same found set. So, in the Music Detail view there is one record, when I switch to the Menu view there are now 2 records, so the Monthly Printout view will also contain 2 records. I've done some research, but I can't seem to find anything that explains why switching to a new layout (that's associated with a different table) will alter the found set. Am I missing something here?
bcooney Posted August 17, 2009 Posted August 17, 2009 (edited) "This creates a new window, which according to the FMP docs creates a new window with the same found set." Yes, the same found set as the table upon which Menu is based, "main" because that's the window you are in when you click Monthly Printout. You need your monthly printout script to: 1. Go to a find layout in music. 2. Enter find mode 3. Pause 4. Have user click a button that just is set to resume. Call the button Perform Find. 5. If (Getfoundcount)>0, switch to the report layout. 6. Enter Preview and pause 7. Print Edited August 17, 2009 by Guest
Recommended Posts
This topic is 5578 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now