Creating dynamic buttons (FileMaker Pro Advanced)
By using scripts and calculations to evaluate the state of button fields, you can make dynamic buttons that change each time they are clicked.
To create dynamic buttons:
  •
  •
  •
The following example shows how to create a button that changes every time it is clicked.
To define the dynamic button field:
1.
Choose File menu > Manage > Database > Fields tab.
2.
3.
Click Options > Storage tab.
4.
Select the Use global storage checkbox and type the number of button states for the Maximum number of repetitions.
5.
6.
In Browse mode, select the Icons field and choose Insert menu > Picture to add graphics to the Icons field.
Tip  Ensure that all graphics are the same size.
7.
Choose File menu > Manage > Database > Fields tab.
8.
9.
Click Options > Auto-Enter tab.
10.
For Calculated value, click Specify and enter the function GetRepetition (Icons; 1).
11.
To create the dynamic button script:
1.
Choose Scripts menu > Manage Scripts and click New.
2.
3.
Add a Set Field script step.
4.
Select Specify target field and click Specify.
5.
6.
For Calculated result, click Specify.
7.
Case (
icons::Buttons = GetRepetition (icons::Icons; 1); GetRepetition (icons::Icons; 2);
icons::Buttons = GetRepetition (icons::Icons; 2); GetRepetition (icons::Icons; 3);
icons::Buttons = GetRepetition (icons::Icons; 3); GetRepetition (icons::Icons; 4);
icons::Buttons = GetRepetition (icons::Icons; 4); GetRepetition (icons::Icons; 5);
GetRepetition (icons::Icons; 1)
)
8.
To connect the field and the script:
1.
In Layout mode, select the Buttons field and choose Format menu > Field/Control > Behavior.
2.
Deselect both Allow field to be entered checkboxes and click OK.
3.
Choose Format menu > Button Setup.
4.
Select Perform Script and specify Toggle Buttons.
5.
You can switch to Browse mode and test your dynamic button. For more information about using buttons with scripts, see Using buttons with scripts.
Note  FileMaker Pro Advanced may not be available in all of the shipping languages of FileMaker Pro.
Related topics 
Displaying databases in Kiosk mode (FileMaker Pro Advanced)
Creating Kiosk solutions (FileMaker Pro Advanced)
Using scripts and buttons to control Kiosk solutions (FileMaker Pro Advanced)
Creating scripts to automate tasks
Working with formulas and functions