4 Replies Latest reply on Nov 19, 2008 5:07 AM by CountryBoy1

    Script in Table View?



      Script in Table View?


          Can entering a certain value into a field in a Table1 (in Table View mode)

      cause a calculation to call a script (as opposed to executing calculation functions)
      that could do lookups of another field in a Table2 for multiple records of the
      same key, make a determination, and put an appropriate value into another field
      of Table1 ? 

         In other words, is there a way to cause a certain value entered into a field
      (in Table View Mode) to trigger a script which will look up values in another table
      and put an appropriate value into another field of the original table ?

         I do realize that you can put buttons which execute script in a Form or List Layout. 

       This is for Filemaker Pro 9 Advanced.






        • 1. Re: Script in Table View?



          "I do realize that you can put buttons which execute script in a Form or List Layout."


          You can have buttons even in Table View, providing that buttons are in the Header or Footer part and those part are made visible.



          • 2. Re: Script in Table View?



            You can trigger a script in table view by editing a field using the Software4Humans EventScript plugin.




            Use the S4HU_EventScript function in a new field that references the field you want to trigger the script, specifying the script to run and this will do the trick. And you could add a calculation to only trigger if a curtain value is entered.


            The script will trigger when the change is committed, which is when the user clicks or tabs out of the field after making the change, so I would suggest, if possible, to have the user select the value from a pup-up menu or drop-down list.


            Have a look into it and if you need anymore help on this let me know.

            • 3. Re: Script in Table View?



              Thank you for your post.


              The answers provided by raybaudi and Orlando are excellent (Thank you!).


              However, there may be another option here that could be overlooked.


              There is a lookup function in FileMaker Pro that allows you to lookup a value in another table and pull that information and place it in a field in the current file.  You did mention that you have multiple records with the same key, and the lookup finds the first occurrence.  However, you can compound the key, so that the lookup satisfies the first request.


              Again, without knowing exactly what you are trying to accomplish (an example would be helpful), this may or may not work, but I thought it should be mentioned.



              FileMaker, Inc.

              • 4. Re: Script in Table View?

                Dear Daniele:


                      I've been away from my computer for a couple of days.  Thank you

                  very much for your tip about buttons.  I didn't realize that they could

                  be visible in a Table view.