Learn how we created Groovy Dialogs
Check out our blog post How to create Groovy Dialog Boxes in FileMaker 16 to learn how we created Groovy Dialogs. You can follow along with the tutorial if you like, or just download the demo and implement it into your own solutions.
How to add Groovy Dialogs to your own solutions
Here are the steps to add Groovy Dialogs to your own solutions:
- Download the demo files.
- Copy the Custom Function from the demo file over to your own solution.
- Copy the scripts from the demo file over to your own solution.
- Create a new blank layout in your solution called ‘Groovy Dialog’.
- Remove the layout’s header and footer.
- Copy the contents of the Groovy Dialog layout from the demo file over to your solution.
- Edit the ‘Groovy Dialog’ script within your solution and set the ‘New Window’ step to use the ‘Groovy Dialog’ layout.
How to display a Groovy Dialog
Once you have implemented Groovy Dialogs into your own solution as per the instructions above, you’re ready to start displaying Groovy Dialogs in your own solution.
Instead of using FileMaker’s ‘Show Custom Dialog’ script step, you use the following Perform Script step:
Perform Script ["Groovy Dialog", "Title|Message|Button1|Button2|Button3|Button4"]
Perform Script ["Groovy Dialog", "This is my Title|This is my message|Close"]
How to get the button that was pressed
To get which button the user pressed, all you need to do is substitute FileMaker’s Get(LastMessageDialog) with the $$ButtonResult global variable.
IF [ $$ButtonResult = 1 ]