6 Replies Latest reply on May 1, 2012 8:49 AM by philmodjunk

    FMP 11 always opens to a specific record



      FMP 11 always opens to a specific record


      I am using a database set up by someone else and when I open it, it always opens to a specific record, not the first record in the database. Does anyone know how I can change this to open to the first record?

        • 1. Re: FMP 11 always opens to a specific record

          Hi Barbara

          It all depends on how you define the 'first' record - there are a multitude of ways that a database can be sorted, on a serial number, on a person's name, on a date of the record being entered etc etc..

          Possibly what has happened is that your predecessor has set up a process whereby the database is sorted into a particular order as soon as it is opened. This would be by means of a script, which is set to run on Open. Go to File>File Options>Open/Close, and this will indicate if a script is being run on Open. If so, you will need to check this script and edit it to sort in your desired order.

          You can always check if a db is sorted/unsorted as this will display in the Status Area alongside the number of records. Which particular field(s) it is sorted on is slightly more tricky to determine. You may need to experiment with different sort orders before you settle on the way you'd prefer it. Go to Records>Sort Records and select one - or more - fields to sort on, ascending/descending order etc.


          • 2. Re: FMP 11 always opens to a specific record

            Have you checked if there is a script trigger that runs when the layout is opened?

            You can check by going to Manage Layout > (select your layout) > Edit > go to the Script Trigger tab > check here if any Events are checked.

            Another solution might also be to write your own script trigger. Using the same path as above, select OnLayoutEnter > choose Go To Record the default for this script is to go to the first record. According to how your records are sorted you will be directed to the first record on your layout.

            • 3. Re: FMP 11 always opens to a specific record

              Thanks very much for your response(s). "First" record should be Last Name sorted ascending but it always opens to record 92 (last name starts with K).  I have looked at the Script Trigger and it says Sort by Last Name then first. It does that but it OPENS to record 92. Michelle, I need clarification...do I create a new script and name it Go To Record? Because I don't see an existing script named that. Obviously I'm not used to working with scripts. Thanks for your patience!

              • 4. Re: FMP 11 always opens to a specific record

                Hi Barbara

                Michelle's right - you can create a script - called anything really, but 'Begin' or 'Open' or something suitable, it need only contain one script step "Go To Record", default is First, then save that, then you need to go Manage Layouts>(select the layout) then setup your new script to run when that layout opens. 

                You can do this on File Open instead as I mentioned in previous post, both ways are equally valid. Setting it up as a File Open script step can also serve the purpose of directing the user to a particular layout, for example you may not want all users to see all data, so you can test for their username, and present a different layout.

                Of course this 'Open' script can also do an initial sort, set up a window name, turn off the status area if you don't want other operators to see it. Scripting is hugely helpful, but takes a bit of getting used to.

                As to why the db is opening on Record # 92, you will need to be certain that there are no other scripts that may over-ride the name sort order - happy hunting!

                • 5. Re: FMP 11 always opens to a specific record

                  Thanks so much for further explanation. I read it at 2 AM and then could sleep...BUT... here is what happens. I go to Manage Scripts>New Script> name it 'Open to First Record'  Then, I want to type in Go To Record but do not have that option. I only have the option of moving one of the existing items from the list at left. How do I get Go To Record into the list to select it for my new script? I feel so dense! Thanks for your time.

                  • 6. Re: FMP 11 always opens to a specific record

                    Double click an item listed on the left to add it as a step in your script. Many such steps then have parameters that you select after adding the step to your script. Look for buttons and other controls that appear in the bottom of the script editor when you put the focus on a step in your script.