tmas73 Posted November 10, 2008 Posted November 10, 2008 I have a button on my layout that opens a new window with a new layout but same table. When clicked the layout in the new window does not display the same record. How can i change the script to fix this?
Vaughan Posted November 11, 2008 Posted November 11, 2008 If the new layout and the old layout share the same TO then the same found set and current records will appear in the new window. If they don't then they won't. If the new layout is on a related TO use the Go to Related Record script step to create the new window and change to the appropriate layout (instead of the New Window and Go to Layout steps).
tmas73 Posted November 11, 2008 Author Posted November 11, 2008 (edited) Yes the both layouts are the same table, but it wont display the correct record. You mentioned if it won't.. Why won't it? Thanks for the help T Edited November 11, 2008 by Guest
Vaughan Posted November 11, 2008 Posted November 11, 2008 "Yes the both layouts are the same table..." Same table or same TO? It depends on what TO the script *starts* on. Is the layout in the new window on the same layout as the one the script starts on?
tmas73 Posted November 11, 2008 Author Posted November 11, 2008 The button to press is on the "recipe" table so is the layout of the popup window. Both are the same table.
bcooney Posted November 11, 2008 Posted November 11, 2008 tmas, you're missing a key point. Go to your starting layout, the one that has the button that runs the script. In layout mode, select Layout Setup from the Layouts menu. In the Layout Setup dialog box, what does the "Show Records from" popup say? It needs to say "recipes" which is the table occurrence required for your script to work, since your script goes to the layout "recipes_soap" which is based on the "recipes" table occurrence. By staying with the same table occurrence, you maintain the same current record and found set. I am also assuming that the recipes table occurrence references the recipes table. This can be confirmed by doubleclicking the recipes table occurrence on the relationship graph and seeing what table is selected in the Specify Table dialog box. Remember, when printing, to print only the current record, as you've not handled isolating the record. You could have done a gtrr with a self-join relationship in a new window.
tmas73 Posted November 12, 2008 Author Posted November 12, 2008 tmas, you're missing a key point. Go to your starting layout, the one that has the button that runs the script. In layout mode, select Layout Setup from the Layouts menu. In the Layout Setup dialog box, what does the "Show Records from" popup say? It says "recipes", both the start layout and the print layout use the "recipes" table. There is no TO in this scase. It needs to say "recipes" which is the table occurrence required for your script to work, since your script goes to the layout "recipes_soap" which is based on the "recipes" table occurrence. By staying with the same table occurrence, you maintain the same current record and found set. I am also assuming that the recipes table occurrence references the recipes table. This can be confirmed by doubleclicking the recipes table occurrence on the relationship graph and seeing what table is selected in the Specify Table dialog box. Remember, when printing, to print only the current record, as you've not handled isolating the record. You could have done a gtrr with a self-join relationship in a new window. So I'm really confused, this should work no? I have One table "recipes" two layouts both use "recipes" but it wont display the correct record. Maybe a OSX bug or something? Thanks
Vaughan Posted November 12, 2008 Posted November 12, 2008 (edited) Ugggh, I just realised something: the script changes to Preview mode. It will display the first page, and the first page will display the first record in the found set. If you want to only preview the current record, you need to select it before previewing: New Window Go to Layout Show all records Omit record Show omitted Enter Preview Mode ...etc That will be the problem. It's not an OS X bug or a FileMaker Pro bug. Credit where it's due: I just realised that Barbara picked this up in her last post. : Edited November 12, 2008 by Guest
tmas73 Posted November 12, 2008 Author Posted November 12, 2008 Ok thanks, I tried that now, but it results in a empty page, I guess the popup window causes this?
David Jondreau Posted November 12, 2008 Posted November 12, 2008 Nope, it's not the pop up window. You've changed something else from your original script. The layout recipes_soap is no longer based on a Table Occurence. It won't ever show any records at all.
tmas73 Posted November 12, 2008 Author Posted November 12, 2008 Ok thanks for you guys help. The easiest might just be to post a slimmed down file. Thanks Log:1 Pass:2 Clone9v20_copy.fp7.zip
bcooney Posted November 12, 2008 Posted November 12, 2008 The most elegant solution, imho, is a self-join gtrr new window. Create a relationship from recipe to recipe where recipeID=recipeID. Then use this relationship to go to related record in a new window using the print layout. You've isolated your record. Print and close the window.
tmas73 Posted November 12, 2008 Author Posted November 12, 2008 That works great! Thanks so much! I am a lil scared of having too many Tables and TOs in one solution, but do I have to worry? Does it slow down things? Thanks
bcooney Posted November 13, 2008 Posted November 13, 2008 Don't worry about the amount of TO's on the relationship graph. It doesn't slow things down.
mr_vodka Posted November 13, 2008 Posted November 13, 2008 Don't worry about the amount of TO's on the relationship graph. It doesn't slow things down. Hey Barbara, I just wanted to ride on top of your statement here... -) The amounts of TO do not slow things down on a layout load but it indeed should slow the system down a bit (not significant enough for end users I believe). Each client needs to initially load most of that overhead into RAM.
Recommended Posts
This topic is 5855 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