3 Replies Latest reply on Mar 24, 2011 5:40 AM by CollynHinchey

    go to record in list from drop down in header

    CollynHinchey

      Title

      go to record in list from drop down in header

      Post

      Hello:

      I think I have a fairly simple problem, but I'm having some trouble solving it. I have a layout of manufacturers that is set up only to view in list mode. Since there are quite a few manufacturers, a few hundred, I thought it would be helpful to have a drop-down in the header where a user can select a manufacturer, and a corresponding button that will jump to that manufacturer's record in the body of the layout.

      I set up a global field as the drop-down and populated it with a list that draws values from the primary key field and the manufacturer name field. But what's the script for the 'go to record' button? Is it possible to have this button in the header and have it jump to the manufacturer in the body of the same layout?

      Thanks for any help!

        • 1. Re: go to record in list from drop down in header
          philmodjunk

          Not only is it possible, you don't need the button if you have FileMaker 10 or 11. With those versions, you can set up a script trigger so that when you select a value in the value list, it kicks in and finds the record automatically.

          If you want to find the selected manufacturer's record, you'd use a script like this:

          #Run from layout referring to Manufacturer table
          Enter Find Mode[] //clear pause check box
          Set Field [Manufacturer::MfgID ; YourTable::GlobalField]
          Set Error capture [on]
          Perform Find[]

          If you want to make this record to the current record of a list of all records, add these steps after Perform Find:

          Show All Records
          Sort [No dialog ; Restore]

          • 2. Re: go to record in list from drop down in header
            CollynHinchey

            Thanks for the help. When I set up the script as you suggested I can't select a new value from the drop down list-- actually, the drop down list won't even load long enough for me to scroll through it. Any thoughts on why this might be happening? Also, my global field is set up in the manufacturer table. Should I create a separate table for it as your script implies or is keeping it in the manufacturer table OK?

            • 3. Re: go to record in list from drop down in header
              CollynHinchey

              Oh I had the script trigger set up for 'On Object Enter' instead of 'On Object Exit'. Thanks, works great!!