Conditional formatting only works with alphanumeric data, not images.
But you could set up series of calculation fields with Container result types that display either Null or the contents of a different container field--such as a colored rectangle in a global field or a field in a related table's record. (This is how we produced conditional fill colors before FileMaker added conditional formatting and is still a useful technique with IWP layouts since IWP doesn't support conditional formatting.
I think this is a bit beyond my abilities at the moment. Do you know anywhere there would be an example to download/etc?
If not - no problem - I'll try and make sense of it with a bit of research!
Can I interprit this as follows....
1) Create a new table with three container fields (1 containing a clock icon, another with a phone icon and en empty one).
2) Create a relationship betwen my portal table and the new image container table
3) Create a new calculation field to do something like...
Get (CurrentDate) <= WhateverTable::QuoteDate +7
WhateverTable::StarImage = WhateverTable::EmptyImage
WhateverTable::StarImage = WhateverTable::StarImage
How does something like that look?
It's actually not that difficult to set up.
Here's how to get the first colored rectangle to appear.
Define a container field in your system and specify global storage. I'll assume that it's named Globals::gFirstColor. Put it on a layout somewhere. (Can be any layout and you can remove it from the layout after we load it with the needed colored rectangle.)
While still in layout mode, use the rectangle tool to create a rectangle of the desired color. Don't worry about size or proportions, they won't matter in the final result. Copy this rectangle to the clipboard. Return to browse mode, click on the container field and paste from the clip board to put the rectangle into it.
Now define a new calculation field like this.
IF ( YourDateField > Get ( CurrentDate ) - 7 ; Globals::gFirstColor ) // this will return the contents of gFirstColor if date is at least 1 week old.
Be sure to select "Container" as the result type in the drop down inside Specify Calculation dialog.
Now add this calculation field to your layout. Using the data formatting options at the bottom of the Inspector's data tab, specify that the field both enlarge or reduce graphic to fit and clear the "maintain proportions" option. That way, the rectangle will scale to fully fill the calculation field when it appears.
That's it for one "Timer graphic".
I've tried this out now but don't have any success. I've tried it with a rectangle and also an image.
Attached is the table I've created.
gStar is a container containing the 'png' of a Star
gTelephone is a container containing the 'png' of a Telephone
QuoteDate is the related field from my Quotations Table
Star1 is the calculation field as you explained it.
I still can't get the star to display using that calculation.
I've tried just inserting the gStar field into the portal and that displays the star as expected so figure it must be something to do with the calucation field.
Also the image shows up super small no matter if I select 'Enlarge to Fit'/etc.
Edit: I changed the calculation field from a Global field to a non-global field as all instances would be seperate and still no joy...
Additional info picture...
Star1 should NOT be a global field. What result type have you specified for this field? You need to select "Container" as the result type inside the specify calculation dialog.
"Conditional formatting only works with alphanumeric data, not images."With FMP12 you can have an image that appears or not appears using conditional formatting.The trick is to place a button with an image as its filling option and then conditional format the button to have a transparent fill.
Phil - I posted a comment just above the image saying that I'd changed the field to a non-global field just after I sent the message. It doesnt make any difference... Thanks for all your help but Ray's hit the nail right on the head!
Ray - that solution worked perfectly and the picture displays in the correct proportions too - many many thanks!