3 Replies Latest reply on Apr 3, 2012 10:50 AM by philmodjunk

    Create pop up message when specific field data is selected from a drop down list.



      Create pop up message when specific field data is selected from a drop down list.



      I have a field in my layout called "Account Status". This is a drop down list field with several items on its value list. I would like to create a very small pop up window (about 2 x 2 size) that will appear on top of the layout next to the field the user is on but only when a user selects certain items from the value list of the field. For example: If user is in the field and selects "Open", nothing happens and can move on. If the user selects "Closed" on that field, then a small pop up window appears stating something like "Please be sure that you have completed..blah blah blah" to which the user can exit the pop up window (via a closed button in its corner) and will be back to the field they were left at on the layout.

      Is this possible?


      Thank you!

        • 1. Re: Create pop up message when specific field data is selected from a drop down list.

          This is possible by using a script trigger to perform a script with the New window script step.

          The best trigger to use depends on the value list type used. Radio buttons, check box groups and pop up menus work well with OnObjectModify. Drop Down Lists work better with OnObjectSave.

          You can also use Show Custom Dialog for a simpler script, but you can't explicitly control the size and position of the message.

          On the other hand, you may find using layout text with conditional formatting a useful option. Using your example, put "Please be sure that you have completed..." as layout text on your layout and specify a conditional format that sets the font size to 500 if the value of the field is not equal to "Closed" in order to make the text invisible. As long as your conditional format expressions keep only one block of text visible at a time, you can layer blocks of such layout text on top of each other.

          • 2. Re: Create pop up message when specific field data is selected from a drop down list.

            Hi Phil,

            I wasn’t entirely sure how to go about the steps you mentioned, which I am sure would be successful, but with me being new to this program I am ignorant to many things. After tinkering with it for a while, I was able to achieve a small pop-up window that appeared on top of my existing layout whenever I selected a particular word in that field's drop down list. I used the following procedures to do so. 


            I am working with two layouts in this scenerio - the main layout containing the field with the drop down list, and another one for the pop up message only.

            The main layout’s field has a script applied when selecting the word “Closed” from its drop down list. The Script is named “Warning Message Popup” with the following steps:


            If [Name of table::Name of field = “closed”]

                        New Window []        

                        Go To Layout [“Warning Message Popup” (Name of table)]

            End If



            Additionally, the Warning Message Popup layout has a layout setup applied with the following script trigger:

            The event labeled “OnLayoutEnter” is checked and the script applied is named “Resize Warning Message Popup” which has the following steps:


            Move/Resize Window [Current Window; Top: 300; Left: 800]

            Adjust Window [Resize to Fit]


            Also on the Warning Message Popup layout, I have a small "x" button (symbolizing to close the window) where the button setup is set to Close Window (Current Window) so that once selected is will close the popup layout from the screen, thus going back to the main layout originally worked in. 


            It seems to work, though I'm not sure is the easiest/proper way. Any thoughts or comments are appreciated. 


            Thank you once again!


            • 3. Re: Create pop up message when specific field data is selected from a drop down list.

              If you put a global field on the "warning message" layout or (if you have Filemaker 11) put <<$$Global variable>> on this layout, your script can assign the message text to the global variable and then you can use this one layout for multiple messages. You can set layout anchors on this field or <<merge text>> so that changing the size of the window expands or contracts the space used to display the message if you want. You can eliminate the Move/Resize WIndow script step if you include those details in the original New window step.

              While you can put a button on the layout to close the window, it comes with a close button the corner that already does that for you.

              Two technical issues to watch out for:

              If you try this on a windows system with windows maximized, the orignal window can resize to a completely unexprected window size when new window opens the new message window. In such cases, best you can do is to use Move/Resize Window to resize the original window back out to the limits of your monitor screen to minimize the window size change.

              If the user clicks on the original window, the message window will disappear back behind it. You can make such a window "modal" by putting a pause into the script that opens it. Then the user cannot interact with other windows until they close the message window. If you do, you need to include steps that halt or resume the paused script when closing the window. (A custom menu can be added, if you have FileMaker Advanced, that will halt the paused script when you click the close box on the corner of your window.)

              You might examine my Known Bugs List database for examples of using New Window to open up small message windows. http://www.4shared.com/file/8orL8apk/FMP_Bugs.html