Posts

Card Window “Picker” Technique in FileMakerPro 16

Display a Layout as a Modal Dialogue

Arin Preston, 1/22/2018

Technique Overview

This is a cool technique I learned from a John Mark Osborne video I came across while working on a current project for Lincoln Electric. This is one of the new features in version 16 and it is very useful – in this case I used it for filtering and selecting values values in a list based on another table using a layout created for the process. Card Windows do not function in WebDirect, but it will not break a script – a new window will display instead and the filter functionality still works nicely. In FileMaker Pro you have to be more careful because scripts will break if users are accessing the file with older versions, as with many new features.

 

Card windows drop down from the center of the title bar and there is an option to shade the window behind it –  a nice visual feature. But the most powerful aspect of this new feature is that you can display a LAYOUT as a dialog and it is modal to the current window.

So this really opens new doors for customizing dialogs in ways we never could before. You can customize the look and feel, add more buttons, input fields, graphics, etc.

Here are the scripts from the Lincoln file where I used this technique to build a dialog “picker” for manufacturers that includes a quick find filter.

Here is a link to the John Mark Osborne video: https://www.youtube.com/watch?v=EZt2Tu_0Apk

___________________________________________

#  PURPOSE: popup modal card window for filter/search mfg list

#

#  PARAMETERS:

#

#  CALLED BY: mag glass button by mfg list on input data layout

#

#  HISTORY: created 10.29.17 | arin preston

#

#  DEPENDENCIES:

# ___________________________________________

 

If [ PatternCount ( Get ( ApplicationVersion ) ; “16.”) or Get(SystemPlatform) = 4 ]

Commit Records/Requests [ With dialog: Off ]

New Window [ Style: Card ; Using layout: “PC_Mfg Picker” (Manufacturers) ; Height: 600 ; Width: 475 ; Top: 0 ]

Set Field [ Manufacturers::quickFind ; “” ]

Show All Records

Sort Records [ Restore ; With dialog: Off ]

Go to Record/Request/Page [ First ]

Scroll Window [ Home ]

Go to Field [ Manufacturers::quickFind ]

Exit Script [ Text Result:    ]

End If

 

Go to Object [ Object Name: “alt_mfg_field” ]

 

________________________________________

#  PURPOSE: filter list of mfg, quick find feature

#

#  PARAMETERS:

#

#  CALLED BY: onmodify trigger quick find field on mfg picker layout

#

#  HISTORY: created 10.29.17 | arin preston

#

#  DEPENDENCIES:

# ___________________________________________

Set Error Capture [ On ]

Commit Records/Requests [ With dialog: Off ]

Enter Find Mode [ Pause: Off ]

Set Field [ Manufacturers::manufacturerName ; Manufacturers::quickFind ]

Perform Find []

If [ Get(FoundCount)=0 ]

Show Custom Dialog [ “No matching manufacturers.” ]

Else If [ IsEmpty ( Manufacturers::quickFind ) ]

Show All Records

End If

Go to Object [ Object Name: “quickfind” ]

___________________________________________

#  PURPOSE: facilitates use of arrow keys in picking process

#

#  PARAMETERS:

#

#  CALLED BY: onlayoutkeystroke trigger on mfg picker layout

#

#  HISTORY: created 10.29.17 | arin preston

#

#  DEPENDENCIES:

# ___________________________________________

 

Set Variable [ $key ; Value: Code ( Get(TriggerKeystroke )) ]

If [ $key = 31 ]

Go to Record/Request/Page [ Next ; Exit after last: Off ]

Else If [ $key = 29 ]

Go to Record/Request/Page [ Previous ; Exit after last: Off ]

Else If [ $key = 10 ]

Perform Script [ “Mfg Picker [Select]” ]

End If