2 Replies Latest reply on Mar 30, 2009 8:18 AM by dinora

    Script Question

    dinora

      Title

      Script Question

      Post

      I am building a layout which will have options to create new records on other tables from this layout

       

      For example

      From my city Table -  I display the airports that serve this city and also I display the hotels located in this city -  (two portals) one for airport and one for city

       

      In the event an airport or a hotel is not on the list - I want to be able to show a button to create an airport and a button to create a hotel -  So far I have accomplished this

       

      What I want is when this new window opens to create lets say a hotel - I want to have two buttons one that say done once I am finished entering the new hotel or if cancel if I want to return to the previous layout

       

      My question is can I have a general script to accomplishes the done button and the cancel button so that I can apply it for the airport and the hotel?  Or do I have to create a script for each -

       

      Thanks

       

        • 1. Re: Script Question
          TSGal

          Dinora:

           

          Thank you for your post.

           

          You can have one script to accommodate each action.  When you set a button to perform a script, there is an "Optional script parameter" that you can pass along with the script.  Therefore, when you click the "Done" button, you can have "Done" passed with the script.  At the beginning of your script, you could have:

           

          If [ Get (ScriptParameter) = "Done" ]

           

          followed by all the steps you want if the "Done" button was pressed.

           

          Let me know if you need clarification for how to implement this.

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Script Question
            dinora
              

            Thanks TSGal

             

            I got it