Change color of a view item conditionaly

I’ve got a db that tracks properties that we manage.One of the fields is the date that the lease expires, and one is the date our mannagement contract expires.

I’d like to show days till expiration, and then show “expired” in red afterward in the olums.

Can somebody help me with the LS for this?

This is a notes client only app.

thanks in advance

Jim Lamb

Subject: Change color of a view item conditionaly

Create a hidden column to the left of “Lease or Contract Expiration” column. If you do not want the color to continue for the rest of the row for other columns in the same row, create another hidden column after the “Lease or Contract Expiration” column. Ie. Hidden column, Before & after this column.

Select the color property “Use value a color”

for both of these hidden columns.

Create a computed field in the related Form which should contain the color value to be used in the view. Map this field to the left hidden column.

Tha value of the computed field should be as:

@If(StatusField = “Lease”; “255:255:0:1:1:1”; “150:200:0:1:1:1”)

Get the correct values of these first three numbers which is for eg. “255:255:0”, from the color palette of the properties of a view or form or any element, to suit your requirement color.

So bottomline, store this color value into a text field in document. Map this field directly in the view which gives you color for that column.

If you do not want this color to continue for the whole row from that column, give the value related to white color from the color palette followed by three 1s as “255:255:255:1:1:1”, in the right hidden column,which you created after the “Lease or Contract Expiration” column.

This way you get that column conditionally, based on whether expired or not.

If you have categories, put the left hidden column to even to the left of categorized column, so that whole can be colored. This is just for information.

Hope this helps.Good luck

Subject: RE: Change color of a view item conditionaly

Wouldn’t it be easier just to have column after the expiration date with a formula in it, such as

@If(ExpirationDate >= @Today;“Expired”;“”)

and set the color for the column to Red.

If we’ve met or passed the expiration date, then Expired shows in red, else null shows wigh no color.

Subject: RE: Change color of a view item conditionaly

This would be easier, but it has the disadvantage, that with @today the view always rejects its index. That works ok for small databases, but with large databases it is not practical because the view index would be rebuild every time the user opens the view.Rather build an scheduled agent that sets a status field to “Expired”.

cti