3 Replies Latest reply on Feb 11, 2013 9:41 AM by tomgregiv

    How to create a custom dialog box to choose a layout

    tomgregiv

      Hi,

      I have created a sick leave database hosted by FileMaker server. I have created 3 different layouts to fit desktops, iPads, and phones.

      I would like to present a dialog box asking the user to choose which layout to view depending on what device they are using and when selected that layout will show.

      Is this possible? I know that I can run scripts to change the layouts but I can't seem to incorporate it with a dialog box. Help would be greatly appreciated.

        • 1. Re: How to create a custom dialog box to choose a layout
          BenHutson

          Hi Tomgregiv,

           

          You could use the Get(ApplicationVersion) function to automatically tell which platform they are on and send them to the appropriate layout.

           

          Here is the official FileMaker definition of the function:

           

          https://www.filemaker.com/12help/html/func_ref2.32.17.html#1028783

           

          Something like:

           

          If [PatternCount(Get ( ApplicationVersion );"iPad")]

          Go to Layout ["iPad"]

          Else If [PatternCount(Get ( ApplicationVersion );"Go")]

          Go to Layout ["iPhone"]

          Else

          Go to Layout ["Desktop"]

          End If

           

          Hope that helps, if you specifically want to make a dialog box, and not do it automatically, then  you could create a value list with a script trigger on modify.

           

          Best Regards

           

          Ben

          • 2. Re: How to create a custom dialog box to choose a layout
            Mike_Mitchell

            Hello, tomgregiv.

             

            A couple of different ways.

             

            1) You can associate a global field with a button in the Set Custom Dialog script step. You can capture that selection with the Get ( LastMessageChoice ) function. Then, use a series of If [ ] and Else If [ ] statements to go to the layout you want.

             

            2) You can build a layout that has three buttons on it. Each button executes a script, Go to Layout [ calculation ], then use a script parameter on each button to tell FileMaker which layout to go to.

             

            HTH

             

            Mike

             

            P.S. Another way to look at this would be to use Get ( ApplicationVersion ) to return what version of FileMaker is running - desktop, iPad or iPhone - and have FileMaker automatically go to the correct layout without prompting the user at all.

            • 3. Re: How to create a custom dialog box to choose a layout
              tomgregiv

              Ben and Mike,

              I do appreciate your help.  I think the simplest way is to use the Get (ApplicationVersion).  Works like a charm!

              Thanks again!