1 2 Previous Next 18 Replies Latest reply on Feb 3, 2014 12:23 PM by SteveFinch

    Quick nav buttons

    SteveFinch

      Title

      Quick nav buttons

      Post

           I would like to create a set of quick nav buttons that will jump me to a selected letter of a sorted database

           So lets say I wanted to jump to the vendors that started with  the letter "C".

           Unless you experts know of a smarter way?

           It would sort the database, then jump me to the first Vendor that started with the letter "C"

            

           I know, this sounds so basic, right?

            

           Thanks

           Spike

        • 1. Re: Quick nav buttons
          philmodjunk

               Define a self join relationship between the layout's table and a second Tutorial: What are Table Occurrences? of the same table. Use a global text field as one match field and a calculation field, c1stLetter, defined as Left ( Vendor ; 1 ) to produce this type of relationship:

               LayoutTable::GlobalField = LayoutTable 2::c1stLetter

               Then this script could be used for multiple nav buttons:

               Set Field [LayoutTable::GlobalField ; Get ( ScriptParameter ) ]
               Sort Records [ no dialog ; restore ]
               Go To Related Record [ From table: LayoutTable 2; Using layout: <current layout> ]

               With each such button, you can specify a different letter of the alphabet as the button's optional script parameter.

          • 2. Re: Quick nav buttons
            SteveFinch

                 Spike's mind = Blown!!!!

                 This is so far over my head...

                 My table is called "Data"
                 I think I got the two fields added corectly. I assume I am to add them to the "Data" table.
                 I named them "GlobalField" and "stLetter"

                  

                 "a calculation field, c1stLetter, defined as Left ( Vendor ; 1 ) to produce this type of relationship:  "

                 Not 100% sure of what you are talking about here...
                 C1?
                 ( Vendor ; 1 ) ?
                 defined as Left
                  

                  

                 I can't figure out where to make the script or it will not work.

                 Data::GlobalField ; Get  ( ScriptParameter )
                 Sort Records [ no dialog ; restore ]
                 Go To Related Record [ Data::stLetter; Using layout: Data ]


                 Sorry to be so stupid

                 I am trying to put the big boy panties on... But they keep falling off... ;0

                  

            • 3. Re: Quick nav buttons
              philmodjunk
                   

                        a calculation field, c1stLetter, defined as Left ( Vendor ; 1 ) to produce this type of relationship:  Not 100% sure of what you are talking about here...

                   In my example the field was named c1stLetter. You can, of course name the field any way that you want. But this would be a new field added to your table defined as a field of type calculation. You can use Manage | Database | Fields to add more fields to a table in your database.

                   Left ( Vendor ; 1 )

                   Would be the calculation expression that you would define for that calculation field. Since you referred to "vendors" in your original post, I am guessing that the field in your table is named "vendor". If it has a different name, you would put that name in place of "Vendor" in this expression. The Left function can be looked up in FileMaker help if you need to know how it works.

                   

                        I can't figure out where to make the script or it will not work.

                   Select Manage | Scripts and click the New button. then create your script. The script that you create there should match exactly the script I posted except that you substitute your names in place of mine.

              • 4. Re: Quick nav buttons
                SteveFinch

                     Getting close...

                     Got the table working.. I can see it in the table view....

                     Still can't figure out how to get the script to paste into the scripts section. It wants me to select aone of the options on the left.
                     I tried the "Set Field" one, but it does not like some of the calc I entered.

                     Set Field [Venders::GlobalField ; Get ( ScriptParameter ) ]
                     Sort Records [ no dialog ; restore ]
                     Go To Related Record [ Venders::Preferred Vendor; Using layout: Data ]

                      

                • 5. Re: Quick nav buttons
                  SteveFinch

                       Does this have anything to do with the fact that I am working with FMP 11?
                       I did get FMP 13, but need to upgrade my system before I can use it on this system.

                        

                  • 6. Re: Quick nav buttons
                    philmodjunk

                         This is the same for all versions of FileMaker. You cannot paste text into the Script Editor. You have to double click scripts steps from the list on the left to add them to your script.

                    • 7. Re: Quick nav buttons
                      SteveFinch

                           Ok, so I have to click each script.

                           Looks like the first one is "Set Fields"
                           Next one is " Sort Records"
                           Last one is " Go To Related Record"

                           I am slow, but I think I am getting it....


                           Will report back shortly

                            

                      • 8. Re: Quick nav buttons
                        SteveFinch

                             That did not work...

                             I feel SO stupid.

                             Should I be selecting the "Perform Script"  I just do not  see what to select..

                              

                        • 9. Re: Quick nav buttons
                          philmodjunk

                               Your buttons should be set up with the Perform Script option. Select it, then click the specify button in order to select the script that you created.

                          • 10. Re: Quick nav buttons
                            SteveFinch

                                 Sorry, I got that part.

                                 I can not seem to write the script(code) anyplace.
                                 From this window (image) Not sure where to go at this stage.

                                 I can not seem to figure out where to put the code you gave me.

                            • 11. Re: Quick nav buttons
                              philmodjunk

                                   To repeat what I posted before: Double click a step on the left to add it to the script on the right. While the script step is selected on the right, use the bottom section "script step options" to specify the needed options for that script step.

                              • 12. Re: Quick nav buttons
                                SteveFinch

                                     Ok, got it working Kind of...

                                     When I click the button, it sorts the database to whatever the current "vendor" is that happend to be in that cell.

                                     I know I missed a part you already told me, I think it is the ( ScriptParameter ), just not sure of the format.

                                      

                                      

                                • 13. Re: Quick nav buttons
                                  philmodjunk

                                       Please Upload a screen shot of Manage | Database | Relationships. I think you need to change the settings for the Go to Related Records Step, but need to see what you set up in order to be sure.

                                       When You set up the button to perform this script, you have to open a Specify Script dialog where you select the script to be performed. There's a box at the bottom of that dialog where you would type in the letter A to be passed to this script as the script parameter. Once this works for "A", you can make a copy of this button, change the parameter to B and the same script will take you to vendors starting with the letter "B".

                                  • 14. Re: Quick nav buttons
                                    SteveFinch

                                         Here ya go

                                    1 2 Previous Next