Dialogs are nothing new. As a developer, it’s the primary form of developer-to-user communication. FileMaker’s “Show Custom Dialog” functionality is great for showing errors and gathering bits of input before, during, and after a call stack. FM’s dialog does come with its own set of limitations. There are times when a dialog would be helpful, but the “Show Custom Dialog” script step is not exactly suited for the situation. First, FM’s dialog waits for user input, pausing the script until input has been received, but user input is not always necessary. Second, if a script is running that, for one reason or another, requires time to complete, the user is stuck in this “waiting state” with no clear indication of what the current script is doing. They may see an asynchronous progress indicator or Spinning Wheel of Death (or SWOD, as the kids say), but no real indicator that something is supposed to be happening. Third, FM’s dialog window size and location is stored within the confines of the FileMaker Pro app library, not controllable by the developer.
The “ModularDialog” module can be used to display a dialog while allowing for little to no user interaction. It can be used as a simple Info/Warning/Error notification or for alternative purposes, like showing progress indicators, records counts, etc. Designed to be easily copied into a solution, it uses a few basic FileMaker objects, a slide control panel, and one simple script used to show or hide the dialog.
Using the module is simple. Copy and paste the module script folder “ModularDialog”, then copy and paste the grouped object onto any layout. The objects are grouped in a particular way so it can be easily resized. Call the script “ModularDialog” and pass the text to be shown in the dialog. To clear the dialog, click the dialog box or call the same script and pass empty variables. For example, to hide the dialog after a number of seconds, use the “Install OnTimer Script” to call the “ModularDialog” after the specified interval. The included script “ModularDialog Example” gives an example of how to show and hide the dialog, using the “Install On Timer” script step.
- Must be FileMaker version 13+ (required for using the slide control object)
HOW TO INSTALL
- Copy or import the ModularDialog script folder to your solution
- Copy the grouped ModularDialog Slide Panel Object to each layout in the solution where the dialog is needed
- In the example file, go to Layout Mode, and the object will be visible in the upper-right corner of the “PBS” layout
- Paste and set the object in the desired location. Typically, this would be in the upper-right corner of the layout.
HOW TO USE
To show the module, call the script “ModularDialog Controller” and pass the following parameter:
Let ([ $$ModDialog = "This is an info dialog" ; $$ModDialogType = "Info" ]; "" )
To hide the module, click the dialog or call the script “ModularDialog Controller” and pass the following parameter:
Let ( [ $$ModDialog = "" ; $$ModDialogType = "" ]; "" )
The module can be downloaded over at the Portage Bay Solutions blog page