12 Replies Latest reply on Dec 7, 2009 5:43 PM by mattb

    How do you do this in FMP?

    mattb

      Title

      How do you do this in FMP?

      Post

      This should be really simple.  I want the user to be able to skip to a particular record # in the table by typing in the record #

      and clicking a button on the layout.

       

      The status toolbar will be turned off for the user, so that's not an option.  I know I can assign a "Go to Record" via calculation (and dialog box)

      script step to the button and this does work, but it's clunky in terms of the interface - I really don't want a dialog box popping up.  I figure

      this should be able to be done directly on the layout, except that I can't figure out how.

       

      My original thought would be to create a variable and use that variable to pass as a parameter into the Go To Record via calculation (without

      dialog box) script step.  Except, how does one put an input box on the layout that accepts a variable - all input boxes seem to be tied

      to table fields in FMP.  By necessity, the record # has to be input by the user and by my way of thinking it shouldn't have to be tied

      to a table field.  And its not properly the subject of a Find operation either.

       

      In Visual Foxpro, I used a "spinner" object which is an input field with up and down arrows that could be used to dial in a number (with upper

      and lower limits) or the user could type the number in directly.  

       

      So...what I do I do to accomplish this as described??

       

       

       

      Matt Bloomfield

        • 1. Re: How do you do this in FMP?
          comment_1
             You must use a field to accept user's input. A global field would be a good choice here.
          • 2. Re: How do you do this in FMP?
            bbarreto
              

            Hi,

             

            What you can do is create a Global field (you can put it in the current table which this layout is based off of, or if you have a table used for resources you can put it here, I recommend using a Resources table).  To create a global field simple create the field as usual (most likely a number field for your needs here), and then click on Options.  Click on the Storage tab, and under the section for Global Storage check "Use Global Storage (one value for all records)".  Now you can put this field on the layout and use it in place fo having a variable.

             

            Create a New Script, you can call it "GoToRecordNumber".  The only script step will be "Go To Record/Request/Page" and in the Script Step options specify "By Calculation", and in the resulting Calculation dialog boxset it to the Global field you created.  Also in the script step options you should now see "Perform without Dialog", make sure to check this as this will make sure the user doesn't encounter a dialog box.

             

            Next, although you will be using a button on your layout your step will be Perform Script rather than Go To Record, and the script will be "GoToRecordNumber".  

             

            Hope this helps!

            • 3. Re: How do you do this in FMP?
              ninja
                

              mattb wrote:

               I want the user to be able to skip to a particular record # in the table by typing in the record #

              and clicking a button on the layout....

               

                Except, how does one put an input box on the layout that accepts a variable - all input boxes seem to be tied

              to table fields in FMP.  ...

               

               And its not properly the subject of a Find operation either.

               


              Howdy Matt,

              It is very properly the subject of a find...that's one of the best uses of a find when navigating records.

               

              Fields are tied to tables...but what's the difference?  Put a "Find" field (global) on your layout, tied to whatever table you want.  The field won't do anything to the table.  Just use the field to hold the data you're looking for (Record#).

               

              The user types in a record#, hits the button, and the following script is performed:

               

              Set Variable [$Find ; Table::Findfield]

              Enter Find Mode

              SetField [Table::RecordNumber ; $Find]

              Set Error Capture [on]

              Perform Find

              SetField [Table::Findfield ; "" ]

               

              And they land on the record they want.

              I, personally, would include a "Show All Records" step at the end of the script so that the user lands on the record they want, but not in a found set of 1 so they can scroll forward and back from the found record.

               

              I think this is what you're after...but you're the judge.  What do you think?


              • 4. Re: How do you do this in FMP?
                mattb
                  

                Comment, Bbaretto, Ninja :

                 

                Thanks for your replies, and you are all correct about creating and using the Global field.  I guess I didn't understand the concept, coming

                from Visual Foxpro as I do.  The GoTo Record by calculation was the more useful method rather than using Find for my purposes.

                 

                Different question:  Do you know if there is some way of turning off the bottom bar on all windows (the one with the zoom images etc.).  I'd

                like to do that if I could...

                 

                 

                 

                Matt Bloomfield

                • 5. Re: How do you do this in FMP?
                  philmodjunk
                    

                  "Do you know if there is some way of turning off the bottom bar on all windows (the one with the zoom images etc.).  I'd like to do that if I could..."

                  Sorry, but that's not an option in Filemaker. You're stuck with it whether you like it or not.

                  • 6. Re: How do you do this in FMP?
                    scubed_1
                      

                    I believe that there is only one instance of a global storage field in the database and not one for each user. So in a multi-user environment there is a slim, but real chance that you might get erroneous results if more than one person is doing the look up at the same time. One way to get around this is to have a table that contains a normal field for the data entry and a record for each user name. Once the user has entered the record number in the data entry field, move that field to a local variable and use it to perform your 'go to record' by calculation.

                     

                    Someone correct me if I am wrong on this.

                     

                    • 7. Re: How do you do this in FMP?
                      comment_1
                        

                      scubed wrote:

                      I believe that there is only one instance of a global storage field in the database and not one for each user.

                      ...

                       

                      Someone correct me if I am wrong on this.


                      You are.


                      • 8. Re: How do you do this in FMP?
                        scubed_1
                          

                        Comment,

                         

                        Does Filemaker keep separate global fields for each user?

                        • 9. Re: How do you do this in FMP?
                          comment_1
                            

                          No, it keeps separate values for each user, for the duration of the session. The initial values are the values entered the last time the file was opened in single-user mode. Each user can modify these values independently of others, but they will not be retained beyond the current session.

                          • 10. Re: How do you do this in FMP?
                            scubed_1
                              

                            Thanks. While debugging, I saw an old value pop up and assumed the worst. I guess that it was left over from a single user session.

                             

                            • 11. Re: How do you do this in FMP?
                              ninja
                                

                              scubed,

                               

                              While you can pull the file from the host, set global field values to what you want as "default" values (often blank), then 're-host' it...you can also write Setfield commands in your opening script to set the global fields to the default you want.

                               

                              Other techniques shared on the board also include having a dedicated table for default values of global fields.

                               

                              In any of these ways, you can start each user session with the same global values and avoid surprises like you got.  Comment is correct (of course) that globals are per-user-session.  "Global Globals" have been requested by some, including me, as a future feature.

                              • 12. Re: How do you do this in FMP?
                                mattb
                                  

                                Phil:

                                 

                                "Do you know if there is some way of turning off the bottom bar on all windows (the one with the zoom images etc.).  I'd like to do that if I could..."

                                 

                                Sorry, but that's not an option in Filemaker. You're stuck with it whether you like it or not.

                                 


                                 

                                Actually, not strictly true, if you're using FMP Advanced and doing a runtime in Kiosk mode.  Kiosk mode gets rid of window title bars, the zoom bar at the bottom of each window, pulldown menus...and access to the OS.

                                 

                                Too bad, because I would dearly love to get rid of some window title bars and the zoom bars in my app.  I could even do without pulldown menus, if I had to, but losing access to the OS while the app is running is a deal breaker for me.   They need to make a "Kiosk Light" mode where it does away with all these things, but still allows you access to the OS.  Oh god, another one for the suggestion box.