We used to conditionally change colors on a layout long before we had conditional formating to make it easier. Those "old school" methods still work in IWP.
Define a container field in your database. This can be a field with global storage or field in a related table where X is used as the operator in the relationshp. This field's value has to be accessible for every record in your table.
Insert a colored rectangle into this container field of the color that you want to display as the conditional background color.
Now define a field in your portal's table using the same expression that you would use in a conditional format expression, but put it inside an If or Case Function and refer to the container field when the expression evaluates as True. Select "Container" as this calculation field's result type.
Place this field underneath transparent copies of your fields where you want this "highlight" color to appear.
Here's a sample expression that returns the Highlight color when Field1 is Empty:
If ( IsEmpty ( Field1 ) ; Globals::GlobalContainerField ) // clear the "do not evaluate if all referenced fields are empty" check box.
When you place this calculation field on your layout, use data formatting to specify that the container field both reduce and enlarge to fit the field and clear the "maintain proportions" check box so that the entire field fills with color when the calculation evaluates as True.
Thank you very much for your answer and help! I have tried what you have suggested and sofar success!
Have a great day!
I have two more problems:
1. I just realized that this container field only "remembers" the pasted colored rectangle per session. The moment i log out of FM and log back in, the container is empty. How can I ensure that the container field remembers that I pasted a colored rectangle?
2. The Field1 in my case has to sit on top of the other entry fields in the portal. I can do this with conditional formatting because the box is not a field and it will only show when the current row of the portal is empty. By using the Field1 as you suggested, and this Field1 sitting on top of other fields, now I am unable to enter data to those fields. Is there something I can do about this?
Thanks for your time.
1. If you are hosting your file on another computer with FileMaker Pro, go to that computer, open it without using Open Remote and set the value in the global field there. If you are using Filemaker Server to host your file, pull the file down off the server, open it with Filemaker Pro and load the global field with the graphic.
2. That's why I said use transparent data fields and put this field underneath them. That way, they remain accessible.