7 Replies Latest reply on Jun 17, 2015 1:42 PM by ChangeAgent

    How to create a button in a dialog box to go to specific record

    ChangeAgent

      Title

      How to create a button in a dialog box to go to specific record

      Post

      Doing some particular actions in my DB will bring up a dialog box with an instruction or warning.  Now I want to create such a box with one of the clickable buttons being programmed so it opens to a specific record, and always that specific record.  Preferably this opens in a new window in the same DB.  FYI the record will be in the same layout that is already open. 

      I can however, not find how to do this.  Any help would be appreciated. 

        • 1. Re: How to create a button in a dialog box to go to specific record
          SteveMartino

          Huh?

          You'll have to describe better '...some particular actions...will bring up a dialog box...."  What do you want the dialog box to say?

          1.  So no matter what record you are on, you want to open a second window to display one specific record? Assuming it will always be this particular record, you can hard code it as follows:

               a) If this is the case, the easiest would be to first find the primary key for this record (say it's 235). Then pseudo script:

                  New Window

                  Enter Find Mode

                  Set Field [Table::Primary_key_Field; "235"]

                  Perform Find

          2.  Or do you want to just open up a second window of the same record you are looking at?

              You can use Go to Related Record (GTRR) script step in the script you are in.  If its the same table and layout, it will just open up to the same record, and same found set.  If you want to isolate the record you can:

               a) Use GTRR, new window.  Then use Show All Records, Omit Record, Show Omitted Only script steps.  You can also resize the window and move it so it isn't right on top of the other window.

          • 2. Re: How to create a button in a dialog box to go to specific record
            ChangeAgent

            Thanks Steve, sorry if I explained n a way that is not understood.

            But, you guessed right in your first point.  question, primary key, is that an invisible number/something in the record?  I do not understand the term.  

             

            • 3. Re: How to create a button in a dialog box to go to specific record
              philmodjunk

              A primary key is a field set up with an auto-entered value that uniquely identifies every record in your table. In FileMaker, this is most often a field with an auto-entered serial number or possibly a text field that auto-enters the result of Get (UUID).

              Steve is using a generic name for a field you should already have in your table. Use your field name in place of his.

              • 4. Re: How to create a button in a dialog box to go to specific record
                ChangeAgent

                Thanks Phil! 

                I do not have no auto-entered serial number, can you put those in afterwards?  As that would be a great idea!  There is a creation date and modified date in it, but no auto-entered serial number field.   If I do a auto-entered serial number field retro, how do I get the numbers in?  

                 

                • 5. Re: How to create a button in a dialog box to go to specific record
                  philmodjunk

                  For almost all tables, you should have a Primary Key and it should be your primary match field to use in relationships.

                  You can add the field and define the auto-entered serial number field option, but then you have to update the existing records so that they also have a serial number. Here's how:

                  Go to a layout based on this table. Add the new serial number field to this layout. Show All Records. Click into the field and use Replace field Contents, selecting the serial number option and also the option to update the auto-enter settings on this field. This will assign a serial number to all records in the table and update your "next serial value setting" on the field all at the same time.

                  Side historical note: There once was a time when the only way to use a script to change the next serial value setting, such as after a data import into an updated copy of the file, was to set up a found set of one record and use Replace Field Contents with these two options in order to update the "next serial value" setting.

                  • 6. Re: How to create a button in a dialog box to go to specific record
                    ChangeAgent

                    OK Clear, thanks Phil!  Going to give it a whirl. Once done I tackle the other one.

                    • 7. Re: How to create a button in a dialog box to go to specific record
                      ChangeAgent

                      Thanks Phil, that worked a dream.  Now the other task, but that will be tomorrow, to late now.