Before we could use conditional formatting, we sometimes used a container field filled with a colored rectangle and placed behind a transparent field to highlight it. You can use either a realtionship or a calculation to control whether or not the color appears to highlight the field.
Here's a calculation approach you could use:
Define a global container field and insert or paste a colored rectangle into it. The exact size and proportions are not crucial as long as you don't use something so small that it's only one or two pixels large.
Define a calculation field with an If function like this:
If ( BooleanExpression ; GlobalcontainerField )
Be sure to select "container" in the return type drop down for this field.
In place of "Booleanexpression" put whatever calculation you want just like you would for your conditional format. If it is true, the contents of the globalContainer field are returned and this calculation field can be used to "highlight" the field in front of it. If the expression is false, the field will be empty and the layout's background will show through, leaving the field unhighlighted.
Thanks very much for the quick reply!
I have not worked much with containers, and am wondering how to paste in a rectangle? I don't actually have a representation of it on any layouts.
Put your container field with global storage on a layout somwheres. Enter layout mode. Use the rectangle tool to create one of the color you want. Copy it to the clipboard. Return to browse mode. Click into the this field and paste the copied rectangle.
WHen you place the calculation field that refers to this container field on your layout, use data formatting to specify 'enlarge or reduce image to fit' and clear the "maintain original proportions" check box. This way, your rectangle will expand out the full height and width of your field.
Thanks! Your instructions were very clear and I got container and calculation fields. And I am getting partial results. Here, I have included two screenshots--one of what I see in Filemaker (first image) and one of what I see on the website where the system is running (second image):
The results on the Filemaker image are correct (the three areas highlighted are being tested for empty fields). They are correctly detected as incomplete.
On the website version however, the birth date and phone number fields are not highlighted.
Notice that the fields are not transparent when viewed from the web browser. If the calculation field is the same size as the field it is behind, it will be hidden from view when veiwed from this browser. This is a bit disappointing. I had hoped that fields specified as transparent in Filemaker would also be transparent in IWP. You may need to make the "Highlight" field several pixels taller and wider so that they are outlined in read at least when their calculations evaluate as true.
I thought that this might be the trouble as well, but it does not seem to have any effect. I made the highlight cover half the screen just so that I could see if it was showing up, but it behaves in exactly the same way (only the third of the three highlights appears).
Is this three copies of the same calculation field or three different calculation fields?
What is the exact calculation that you used? (can't imagine a calculation here that would evaluate differently in IWP, but let's chack and be sure...)
Okay, so I am using three different containers and three different calculations.
The containers are addressContainer, birthdayContainer, and phoneContainer. The associated calculations are addressCalculation, birthdayCalculation, and phoneCalculation. The original fields are simply called street, city, birthyear, phone, etc.
My calculations are the following:
(for phone) If ( IsEmpty ( phone ); phoneContainer )
(for address) If ( IsEmpty ( street ) or IsEmpty ( city ) or IsEmpty ( country ) or IsEmpty ( postal ); addressContainer )
All of my containers are global, as you suggested they should be.
You only need one container field referenced by all three calculation fields if the highlight color is to be the same in all three cases.
Of course, that doesn't explain why two of the three calculation fields do not evaluate correctly in IWP.
Is the "do not evaluate if all referenced fields are empty" check box selected or cleared in each of these calculations?
Thanks for the tip about containers!
The check box is cleared in all cases.
I will be away from my computer for about an hour. I really appreciate all of your help so far and for the prompt responses!
So I made only one container (rather than three as I had before). Now, all three highlights show up in Filemaker, and none show up on the website (not even the one I saw before)!
Another odd behavior that is arising: every time I quit Filemaker and restart it, the container that I created to contain my highlighting is empty.
I would greatly appreciate any more suggestions or tips on how to approach this!