11 Replies Latest reply on Jun 9, 2012 9:29 AM by rgnant

    Problems with FreezeWindow



      Problems with FreezeWindow


      I have a script I've moved from FM10 to FM12 and it seems the FreezeWindow script step is not functioning.


      As soon as I go to a new layout using the same table, it switches to that layout.

      This is another headscratcher that thinks i MUST have found a bug.  ;-)




        • 1. Re: Problems with FreezeWindow

          First, check to make sure that you don't have a layout or record based script trigger set up on your "Table: Home" layout that might be refreshing the window. If you have an OnRecordLoad or OnLayoutEnter trigger on that layout, this script will trip that trigger and the script will be performed.

          Likewise, OnLayoutExit on the current layout would be tripped by this script.

          • 2. Re: Problems with FreezeWindow

            If the above script is your entire script, I don't see a need for Freeze Window. The window will update anyway when the script ends--and it's unlikely the user will see any difference when it does so.

            • 3. Re: Problems with FreezeWindow


              Thanks for the prompt response.

              The script shown is just a part of a longer script.  I have checked for script triggers on either layout, and all of the fields, yet it stll acts the same.

              I'm baffled.

              • 4. Re: Problems with FreezeWindow

                Try posting the entire script. The step that actually produces the screen refresh could be lower down in your script. There are certain script steps, such as New Window, that can trigger a screen refresh.

                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. 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.
                3. If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.
                4. 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. (Use the HTML option on the database tab panel and paste the text into the forum's HTML editor.)
                • 5. Re: Problems with FreezeWindow

                  Ok, here it is:


                  • #-----
                  • Freeze Window
                  • Go to Layout [ “Table: Home” (Home) ]
                  • Set Field [ Home::key_Action; "Purge Common" ]
                  • Commit Records/Requests [ Skip data entry validation; No dialog ]
                  • Show All Records
                  • If [ Get ( FoundCount )=0 ]
                  • New Record/Request
                  • Set Field [ Home::key_User; "XYZ" ]
                  • End If
                  • #-----
                  As soon as it goes thru the Go to Layout step the layour changes.  I've even commented out everything below and stepped thru it and it still happens.
                  • 6. Re: Problems with FreezeWindow

                    But since you go to only one layout, why freeze window at all? The screen will refresh at the end of the script anyway.

                    Freeze Window is ususally used in a script where you change layouts, do some stuff and then return to the original layout.

                    • 7. Re: Problems with FreezeWindow

                      Before this scropt executes I put up a splash screen which I'd like to be there for the duration of the script.  This script actually gets longer and there are several more scripts which follow this.

                      I did have a goto(original layout) at the end of this script, but I started whittling things down to track down the issue.

                      I am stymied and I'm about to clone the file, rip everything not related to this out of the file, make it as small as I can, and see where if starts to go wrong. It is very frustrating, I'll keep you posted.

                      • 8. Re: Problems with FreezeWindow

                        Put the script step Go To Layout [original layout] (or some layout other than "Table: Home") at the end of the script and run it WITHOUT the debugger on.

                        What happens now?

                        • 9. Re: Problems with FreezeWindow

                          OK, check this out.

                          Brand new database.  Two fields. Two layouts.  One script.


                          • Go to Layout [ “Layout1” ]
                          • Freeze Window
                          • Go to Layout [ “Layout1 Copy” ]
                          • Pause/Resume Script [ Duration (seconds): 3 ]
                          • Go to Layout [ original layout ]
                          SO, I'm thinging it will go to Layout 1 and stay there for the duration.  Nope.  Flips to layout 2, waits three seconds, flips back.
                          Am I nuts in thinking this?
                          • 10. Re: Problems with FreezeWindow
                            Pause/Resume script step unfreezes a Freeze Window script step.

                            Try another lengthy operation (i.e. a loop)
                            Also make sure that the original layout is noy 'Layout1 Copy', or better make the last step: Go To Layout ["Layout1"] to be sure.
                            • 11. Re: Problems with FreezeWindow

                              OK. I think I am getting it now.  Sort of.

                              Per your advice I ran this

                              • Go to Layout [ “Layout1” ]
                              • Freeze Window
                              • Go to Layout [ “Layout1 Copy” ]
                              • Loop
                              • New Record/Request
                              • Exit Loop If [ Get ( RecordNumber ) > 10000 ]
                              • End Loop
                              • Pause/Resume Script [ Indefinitely ]
                              • Go to Layout [ “Layout1” ]
                              I actually ran it first without the pause script step.  And it worked fine.  No layout switch.  Then I ran it with the script pause step and as soon as it got there the layout switched.  So your reference to the help file is correct - I had seen it, but was too deep into it to pay attention.
                              Actually, my original script did not have any pauses in it, so the pause script step was introduced after I had the problem for debugging purposes.
                              The biggest hassle for me is that when you turn on script debugger the freeze window has no effect when stepping thru a script.  It makes sense I suppose, but it was not what I thought at first.
                              I must have an issue further down in the script somewhere, I'll go dig it out.
                              THis is one of those "issues" I will never forget.  Sigh.  Experience is a tough way to learn sometimes.  Thanks for your help.