1 Reply Latest reply on Oct 14, 2013 10:33 AM by philmodjunk

    List view window to select costumers



      List view window to select costumers



           I think this should be easy but somehow I haven't been able to achieve it, I have a costumer layout where all the costumer data is stored, in it I need a button that opens a new window with a list view of all the same costumers table and then when selecting the desired costumer I want the window to close and display the selected costumer in the original window.

           Thanks in advance.


        • 1. Re: List view window to select costumers

               I will assume that you have a field named __pkCustomerID that identifies each customer uniquely in your Customers table and that you are Using FileMaker 12 and that, if you are using windows, your windows are NOT maximized:

               Script 1:

               #Open Customer List Window
               New Window [ //specify name, position and size of the window here. Use advanced window options to make it a modal window]
               Go to Layout ["Customer List" (Customers) ]
               Show/Hide Toolbars [Hide]
               Show All Records
               Sort Records [Restore ;no dialog]

               Script 2: (perform from button on Customer List layout)

               Set Variable [$CustID ; value: Customers::__pkCustomerID ]
               Close WIndow [Current Window ]
               Enter Find Mode [] ---> clear the pause check box
               Set Field [Customers::__pkCustomerID ; $CustID ]
               Perform FInd []

               If you want, you can select the name fields on the Customer List Layout and use Button Setup... to turn them into a button to perform Script 2 when clicked.

               For more examples of scripted finds that use this format, see: Scripted Find Examples

               If you are using Windows with maximized windows, let me know and I'll describe how to minimize an annoying issue with what happens when you open a new window when windows are maximized.