KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Using color in output forms
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: February 18, 2000
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Color can be a very effective visual cue when used judiciously on an output form. For example, lets say you would like to display companies that are past due more than 60 days with a red background to make them standout from current accounts. Place the following in the object method for the company name field :

`Object Method
---
If ((Current date-OldestOpen)>60)
 SET COLOR(Name;-256*Red )
Else
 SET COLOR(Name;-Black )
End if

The only problem is that you will find the rest of the empty rows in the output layout will be in the same color as the last record displayed in the selection (e.g. all with red background). To prevent this, place the following code into the form method:

---
`Form Method
---
If (Form event=On Header )
 SET COLOR(Name;-Black )
End if
---

More information about SET COLOR.