2 Replies Latest reply on Aug 12, 2010 4:52 PM by LaRetta_1

    Reinstate Most Recent Find?



      Reinstate Most Recent Find?


      I have a script that is writing a record into another table/layout based upon the selection of a radio button. The way I wrote my script I am performing a GoToLayout then New Record/Request into the second table, then going back to previous table/layout.

      The problem I'm having is that if somebody has adjusted the Find and / or Sort in the previous layout, once they click on the button and write the record into the second table they lose their Find / Sort. Is there any command that I can put after the GoToLayout that reinstates the Find / Sort previously selected?

        • 1. Re: Reinstate Most Recent Find?

          Without having seen your script, I can only surmise that if the first table is re-sorting or re-finding when the user goes back to it, then there must be a step in the script which is doing the re-sorting/re-finding, in which case removing that step would appear to be the simplest solution.

          I could be way off base though, so perhaps post your script so we can see...


          • 2. Re: Reinstate Most Recent Find?

            Leaving a layout with a specific found set and specific sort order and then returning to it should NOT change your record set when all you are doing is changing layouts.  Finds and sorts as user-specific so as sunmoonstar_13 suggested, something appears to be happening.  Are you using Go To Related[] by chance?

            Anyway, one lazy easy way is to start your script with two steps:

            Freeze Window

            New Window

            ... you can then go to your other layout and do your thing (in the new window) then close the window and you will be right back where you started (and on same found set and sort order).  You can also preserve found sets by performing a table occurrence switchero using Go To Related[] but you need an additional table occurrence (which doesn't even need to be related). 

            With something simple as you've described, I'd just open a new window but it begs the question ... why is your record set changing when you return using only straight layout switching?