4 Replies Latest reply on Nov 16, 2015 10:14 AM by danielkellett@mac.com

    Create customised search using e.g. 2 date dropdown lists

    danielkellett@mac.com

      Hi,

       

      I have found lots of info on how to script customised searches, but not on how to use pre-populated fields as parameters

      Searchlayout.tiff

      • I have a large table called "events" with dozens of columns
      • I want to search that table and display a selection of columns in a new layout
      • Currently I have inserted a portal into the body with the desired columns
      • I have put 2 date dropdowns and an event type dropdown (from events table) in the header
      • I want to use these to choose a start date and end date, and a event type to display all the events of a particular type between two dates

       

      How do I script that? I figured  I should set triggers on the parameter dropdowns (e.g. create new global variables containing their value, if  they are altered or exited), then have a script something like (pseudocode) :

       

      Go To Layout ("events")

      Enter Find Mode[]

      Perform Find[] - and here specify the criteria as e.g. EventDate = $$Startdate ... $Enddate

      Go To Layout("custom search")

      Sort by[...]

       

      What am I doing wrong?

       

      (Also - I know a layout isn't a table, so you can't relate them in the traditional way by a PK/FK, but can I relate layouts in a similar way, so the Search layout would show up on some dialogs, rather than just the related tables?)

       

      Btw using Filemaker Pro 14 on Mac OS 10.11.11

       

      Thanks in advance for any tips