14 Replies Latest reply on Aug 19, 2013 5:49 AM by photowyzard

    Displaying a Record from Sort - Then return to Original Sort

    photowyzard

      Title

      Displaying a Record from Sort - Then return to Original Sort

      Post

           My situation is as follows:

           We have a script that allows the user to search for records based on a number of search criteria:

           Date Range

           Long In

           Part #

           Warehouse

           Part #

           Purchase Order

            

           You can search by one or more criteria listed above (in other words, by one or more or all the fields).  The Displayed Records list nicely and each record has a vew button so the original purchase document can be displayed out of the sorted group.  For example, 6 records may be found in a search. You can select one of the found records and the original, detailed purchase document opens up. Perfect so far.

           The user would like to return to the ORIGINAL SORTED GROUP after he closes the record he was viewing, gets the information he needed and then closes the window.

           Can you return without a complicated script to the orginal FOUND documents?

           What is happening right now is once the record to view is selected and the window is then subsequently closed, FM goes back to the generic FIND window and you have to input your search criteria again to bring up the 6 records you were viewing in the search result!

           The Users would like to simply click a button and go back to the original 6 documents he found in his search before he viewed one of the documents without having to perform this search again to bring the 6 documents up again.

           Is this possible in FM Pro 12  in a simiple way and what would you suggest!?

           Thanks in advance! Greatly appreciate the help.

        • 1. Re: Displaying a Record from Sort - Then return to Original Sort
          philmodjunk

               This is quite easily done. What is not clear is why the system drops back into find mode. That should not happen just because the user closes another window. You'll need to figure out how/why that is happening--perhaps a script trigger is being tripped that starts the search all over again?

          • 2. Re: Displaying a Record from Sort - Then return to Original Sort
            photowyzard

                 Perhaps I wasn't clear.  What it does after the user looks at the selected record in the found group is, it takes him back to the Original Search Window.

                 It is not in find mode, but in Browse mode.  He then has to search again.  The script/button that returns him to the original window is:

                 Go to Layout["Pref"(Admin)]

                 Go to Object [Object Name: $$tab]

                 Rather than go back to Layout from this record, it should go back to the 6 found records again so he can select the correct record he wants or find more data from the select group.

            • 3. Re: Displaying a Record from Sort - Then return to Original Sort
              SteveMartino

                   So you get to your found/sorted set (6 records).  Then you click a view button to open that record.  If the view button opens that record on a new window, then user closes that window the usual way or with a button with simple Close window script, doesn't this solve the problem and put you back on the layout with the found/sorted set?

              • 4. Re: Displaying a Record from Sort - Then return to Original Sort
                photowyzard

                     No, it resets the search and goes back to the Search input window layout.  I would like it to  go back to the original found set of six records.  I didn't write this DB, I am working on Enhancements.

                • 5. Re: Displaying a Record from Sort - Then return to Original Sort
                  philmodjunk

                       And I again will point out that simply closing the window should return you to the previous window in exactly the state that you left it. If it is not, a script is making a change and you need to modify that script so that it does not do so.

                       If you have FileMaker Advanced, I suggest stepping through the complete process to see where the code kicks in that switches the user back to the search layout/window so that you can determine how to modify the scripting so that this does not take place.

                  • 6. Re: Displaying a Record from Sort - Then return to Original Sort
                    photowyzard

                         I do, thanks.  I will check this out and report back.

                    • 7. Re: Displaying a Record from Sort - Then return to Original Sort
                      ArtL

                           I tried the closing of the window as suggested, it simply did nothing but close the window.  Something in the script resets and resends you back to the entry page.

                           This is the code for the return button, see my second post above.

                           Go to Layout["Pref"(Admin)]

                           Go to Object [Object Name: $$tab]

                            
                      • 8. Re: Displaying a Record from Sort - Then return to Original Sort
                        philmodjunk

                             If you have FileMaker Advanced, enable the script debugger and then watch for scripts to pop up in the debugger that take the original window back to the search layout.

                             One thing else you can check is what do you see in the original window immediately after selecting a record and viewing it in a new window? Perhaps ths script that opens the new window with the detail view also returns the layout in the first window back to your search layout.

                        • 9. Re: Displaying a Record from Sort - Then return to Original Sort
                          ArtL

                               > Perhaps ths script that opens the new window with the detail view also returns the layout in the first window back to your search layout.

                               This is what it is doing. I would like it to return to the 6 found items.  I do have Pro advanced.  The script I posted above is the script for the button to return to the search page (not in find, but cleared to enter a new search).

                                

                                

                          • 10. Re: Displaying a Record from Sort - Then return to Original Sort
                            philmodjunk

                                 That script does not appear to open a window for your detail view so it is not clear when/how it is executed just from the posts here.

                                 What I was guessing was that you had a script like this:

                                 New WIndow [specify new window to show detail view here]
                                 Go to Layout [select form view layout for detail view here]
                                 Select Window [original window]
                                 Go to layout [search layout]

                                 In which case, all you would need is to remove the last two steps of this script. But what you post does not seem to match my guess as to what script might be responsible for the problem you are reporting.

                                 To post a script to the forum:

                                   
                            1.           You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
                            2.      
                            3.           You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
                            4.      
                            5.           If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
                            6.      
                            7.           If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
                            • 11. Re: Displaying a Record from Sort - Then return to Original Sort
                              SteveMartino

                                   What is the script or script trigger attached to the button that takes you to the detail view?  That's the one I mentioned, and the one that Phil is looking for.

                              • 12. Re: Displaying a Record from Sort - Then return to Original Sort
                                photowyzard

                                     Hi Guys, I resolved this.  Not necessarily in the most elegant fashion, but what I did was simply create a second button on the VIEW layout.

                                      

                                     In Button Setup, simply said, GO TO LAYOUT and found the layout.  Task done. When I am not more pressed for time, I will make this better.

                                      

                                     It works, it does what was requested and for now, I am good. 

                                      

                                     Thanks for the help.  Although no one answer was exactly what I was lookin for, you guys did help me out in finding the obvious.

                                      

                                     Much appreciated! :)

                                • 13. Re: Displaying a Record from Sort - Then return to Original Sort
                                  philmodjunk

                                       From your description, you've indicated that you are are opening a new window to view the selected record in detail though you have never shown the script that opens such a new window. Is it possible that your script does not open a new window but just changes layouts?

                                  • 14. Re: Displaying a Record from Sort - Then return to Original Sort
                                    photowyzard

                                         Phil,

                                          

                                         You are absolutely correct.  Figured this out when I looked at the layouts and followed the Debugger more thoroughly.

                                         Again, thanks for your help, greatly appreciated.  I should have looked at this first.