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.
1.
2. Create a field named Icons and choose Container type.
3.
4. Select the Use global storage checkbox and type the number of button states for the Maximum number of repetitions.
5. Click OK.
6.
7.
8. Create a field named Buttons and choose Container type.
9.
10.
11.
1.
3. Add a Set Field script step.
4.
5. Double-click Buttons.
6.
7. Write a Case function that evaluates each GetRepetition test expression for the icon number and increments the number by 1, replacing the table name “icons” with the table in which you created the Icons field.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);
8. Click OK and close the Edit Script and Manage Scripts dialog boxes.
1. In Layout mode, select the Buttons field.
2.
3.
4.
5.
6. Click OK.