2 Replies Latest reply on Aug 30, 2011 11:47 AM by willrollo

    script trigger from a drop down list

      Title

      script trigger from a drop down list

      Post

      HI

      I have looked all over the net and have found a plugin solution for this but thought that maybe the filemaker 11 may have implemented this feature. 

       

      What I have table layout called "invoices" and it has a drop down list that has 3 options, Customer, trade and supplier (from a field called "type" that is in a linked table. User selects what type of client is being entered into the database, by using a drop down menu  - This initial client entry is on another layout called 'new enquiry").

       

      I want to trigger a script for each of these options once selected by the user. The point of this is that The table view i have as a layout will sort accordingly to show invoices to each of these groups...

      I hope this makes sense! I am a newbie at this so please be gentle!

        • 1. Re: script trigger from a drop down list
          philmodjunk

          Yes, you can use a script trigger and there's no need for a plug in with either FileMaker 10 or 11.

          If you permit typing in this drop down field, use either OnObjectExit or OnObjectSave-- I prefer the latter as it only fires if a new value is selected.

          If you do not permit typing (such as with a pop up menu or radio buttons) use OnObjectModify.

          If typing in the field is permitted, OnObjectModify fires with each keystroke so this is why you wouldn't use that trigger when this user action is permitted.

          Your script can be quite simple:

          If [ YourTable::YourDropDownField = "option 1 value"]
             Sort [No Dialog ; Restore ]
          Else If [YourTable::YourDropDownField = "option 2 value"]
             Sort [No Dialog ; Restore ]
          Else
             Sort [No Dialog ; Restore ]
          End If

          • 2. Re: script trigger from a drop down list

            Thanks Phil - perfect. I thought it was something like that but my scriopting skills arent up to scratch as yet!