Submitted by LeftEccoForIQ on 2019/09/21 17:52
I've added these two rules to my Action field (source of main GTD action grid):
 
AM:ItemForeColor=iif([Appointments]>0,&H000080,0)|E:ItemForeColor=iif([Appointments]>0,0,[ItemForeColor])
 
What I want to achieve is that when I add an appointment to the grid by assigning it an [Action] value, the item is shown with a specific text colour both in the grid and in the calendar. When an item is removed from the Action grid and it is an appointment I want the specific color to be removed, or not changed if it isn't an appointment.
 
With the rules quoted above, nothing really happens - the font colour doesn't change when I add appointments to the Action grid. I've tried substituting the 0s with "" as ItemForeColor is a text field as well as just leaving that part blank, but none of these versions work either.
 
Sorry, I don't have much experience either using such rules or with Visual Basic...
 
Thanks.

Comments

I put in some more effort and the following rule worked (I left out the E flag rule for now), but only temporarily and only for All-day events:
 
AM:ItemForeColor=iif([Appointments]<>0,&H000080,"")
 
For All-day events, the text colour is changed reliably in the grid, but in the calendar, the change is only reflected temprarily, for example until I scroll the calendar - when it is reset to black.
 
However, no change at all occured for scheduled events - their text just remained black.
 
So I came up with the idea of creating a text field with Appointments as its source. I called this string version of the date field 'ApptString'. Using this in the rule instead of Appointments made it work for scheduled events also, but again, the text colour change is not permanent and is overwritten when the calendar is updated. (rule: AM:ItemForeColor=iif([ApptString]<>0,&H000080,""))
 
Ultimately, I realized that changing the background colour for calendar events seems to work reliably as opposed to the text colour, so I'll stick with that for now.