HiredGun79 Posted July 12, 2005 Posted July 12, 2005 Hello everyone, I have a table that contains many records and a separate find layout that displays a limited number of those records based on if a field has been set. The find layout is in a popup window. Both layouts are from the same table. What I'd like to happen is when the user clicks on a record in the find popup window, the find window closes and the main window goes to a certain layout and pulls up the record that was clicked on. Basically, it's a "Go to Layout" but in a different window. . . I've tried setting up a temp field to store the record number, close the find popup, go the the correct layout in the main window and do a "Go to Record" and have it go to that record number that was stored. That doesn't seem to work. Any ideas? Thanks!!
Newbies logocop Posted July 12, 2005 Newbies Posted July 12, 2005 Hi-- Unless you want the exact visual effect, you don't need to close one window and open another. Instead, you can simply (1) switch to your desired layout and (2) resize/move/adjust the window to achieve your desired look. You have the Adjust Window, Move/Resize Window, and Set Window Title script steps available (among others) to customize the window. You don't say how your "pop-up window" operates -- for example, does it simply display a list view of all the found records, or is it a single record with a portal showing the found records, or what? If it's a list view, simply give each record a button that triggers a script that does (1) and (2) above. A portal is trickier, since (as far as I know) you can't easily combine the effects of the Go to Related Record and Go to Layout script steps. My approach is to copy a unique identifier from the record in question, go to the new layout, and Find that identifier. The Record Number does not provide such a unique identifier, since it only gives the relative position of the record in the current found set -- a record that's Number 39 when all records are showing may be Number 3 in a small found set. Instead, use the Record ID. There are also other ways to create unique identifiers, which have probably already been described somewhere on this board much better than I can. Unfortunately, thanks to some curious reasoning at FileMaker, the Go to Record script step cannot use the Record ID, which is why I use the second Find. My script copies the unique identifier from the first layout and Pastes it into a Find request on the second. (I use copy and paste since I don't need to retain the value after using it this way.) This is how I do it: Allow User Abort [On] Go to Portal Row [select; No Dialog; By Calculation: Get( PortalRowNumber )] Copy [select; <unique identifier field>] Go to Field [] (Here is where you would close the pop-up window and open the new one [Close Window and New Window script steps], if you choose to do this rather than just adapting the existing window as described above.) Go to Layout [<layout name>] Freeze Window Enter Find Mode [] Paste [select; No Style; <name of unique identifier field>] Perform Find [] Go to Field [] Show all Records (Here is where you would modify, adjust, your existing window if you chose that approach.) Commit Records/Requests [skip data entry validation; No dialog] ----- I'm sure there are more elegant ways to do this, but this one works for me (at least so far!). Good luck! Bill
HiredGun79 Posted July 14, 2005 Author Posted July 14, 2005 Thank you for the reply! I'm going to see if I can get it working now! If I have any more questions, I'll post them, though I think you put me on the right path. . Again, you have my thanks!
Recommended Posts
This topic is 7074 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