There are a number of ways you can do it. Here's a simple, non-scripted approach.
Define a global container field, named WarningIcon. Insert your graphic into this global field.
Define a calculation field with this expression:
If ( Not IsEmpty ( checkBoxField ) ; WarningIcon )
Select "container" as the calculation's return type.
Put this calculation field on your layout and set up the check box field's value list with a single value.
When you click the checkbox the image inserted into WarningIcon will appear.
This looks SOOO easy, yet I am not getting it to work.
Here are my fields:
"Warning Icon" - set as Container type with Global storage. No calculations applied.
"Needs Attention" - set as Calculation type. In the options screen, the "calculation result is.." is set to Container. The calculation applied is If ( not IsEmpty ( Needs Attention: ) ; Warning Icon )
I added the Warning Icon field to the layout and then I drag and dropped my graphic onto the Warning Icon container field (which confused me because it doesn't seem to stay in there for when I move the container field, the icon stays in the same spot as if it was only sitting on top of it, not really applied to it.)
I added the Needs Attention field to the layout (which looks like a Container). However, I cannot select any data properties in the Inspector window to change the control style of that field to a checkbox. It's greyed out on Edit box.
What am I missing. :o(
It is staying on top and is not actually inserted into the container field.
In layout mode, you would copy the icon to the clipboard, enter browse mode, click into the Warning Icon container and then paste the copied image.
You need three fields, not two:
A global container field, a check box field, and a calculation field that uses the value of the checkbox field to determine whether to return the contents of the glogal container field or null (nothing).
But you need a field of type text or type number that can be formatted as your checkbox field.
Then your calculation would be: If ( not IsEmpty ( CheckBoxField ) ; Warning Icon ) )
If you specify a checkboxfield of type number and specify 1 as the single value in its value list, you can resize the check box field to hide the number 1 from view and simplify the above calculation to be:
If ( CheckBoxField ; Warning Icon ) )
THANK YOU THANK YOU THANK YOU! It worked!
I am sure I will be reaching out again as I am only 10 days into using FMP 11.