8 Replies Latest reply on May 18, 2010 2:07 AM by BatMan

    Jump to empty layout (do not show last record)

    BatMan

      Title

      Jump to empty layout (do not show last record)

      Post

      Hi. In an AppleScript I need to jump to a different layout in FM Pro 11 Advanced using the "show layout" command. What I would like to do is show the empty layout rather than the layout filled with data from the last record that was shown in that layout. How can I do that? Is there something like a "show no record" command?

        • 1. Re: Jump to empty layout (do not show last record)
          LaRetta_1

          You can achieve that by scripting:

           

          Go To Layout [ your layout]

          Omit Multiple Records [ without dialog ; Specify: Get ( FoundCount ) ]

           

           

           

           

           

           

          • 2. Re: Jump to empty layout (do not show last record)
            ninja

            Howdy Batman,

             

            LaRetta has already answered the question you asked...may I ask one of my own (in addition to this one)?

             

            Under what circumstances would you want to do this?  I'm having trouble picturing a situation where I would want to go to a layout and show no records at all.  I can understand wanting to see only a new blank record, but not one that I would want a zero found set.

             

            Please humor me if you will....Thanks!

            • 3. Re: Jump to empty layout (do not show last record)
              LaRetta_1

              I'm with you Ninja and I started to ask more questions about the purpose so we could better assist.  I wondered if the request was for a null layout (no fields).  Also, if menu is available and restrictions don't exist (using privileges), then User could Show All Records.  If it is to print an example of the form, you can print with no records.  Thanks for asking the questions that I should have asked (I was in hurry this morning).  :smileytongue:

              • 4. Re: Jump to empty layout (do not show last record)
                BatMan

                Well, the situation is the following: My AppleScript is filling some data into new records. This is done in the mentioned layout to which I let FM change its view explicitly, such that the user can see what is filled in. As soon as it is finished, it changes back to a different layout. After a while, the user might then want to run the script again, i.e. FM will change the view back to the layout where the user will then see the last record that was filled with data the last time the script was executed. I would like to hide that last record, i.e. open the empty layout, to avoid confusion. With your suggestion, LaRetta, this does not quite seem to work yet. There is still a short instance during which the last record can be seen.

                 

                 

                • 5. Re: Jump to empty layout (do not show last record)
                  LaRetta_1

                  "There is still a short instance during which the last record can be seen."

                  Try adding a Freeze Window to the beginning of the script

                  • 6. Re: Jump to empty layout (do not show last record)
                    BatMan

                    Mmmmm, this is weird. Turns out that "Omit Multiple Records [ without dialog ; Specify: Get ( FoundCount ) ]" omits only one of the currently selected records, even though Get ( FoundCount ) returns the correct number (e.g. 20). Only the one currently shown on the layout is omitted! That's why I can still see a record when switching to the layout -- it's just the next one in the queue. Something smells fishy here...

                    • 7. Re: Jump to empty layout (do not show last record)
                      comment_1

                       


                      BatMan wrote:

                      I can still see a record when switching to the layout -- it's just the next one in the queue.


                      I suspect it's actually the previous one. Omit Multiple Records[] starts with the current record. You should begin by going to the first record in the found set.

                       


                      • 8. Re: Jump to empty layout (do not show last record)
                        BatMan

                        Indeed, that did the job!

                         

                        Thank you all for helping me with this.