Submitted by David_H on 2017/05/18 17:42
Would it be possible to set up a condition so that:
- If ALL child items all levels deep are formatted green, automatically format the parent item green?
- If ANY child item, no mater how many levels deep are formatted red, automatically format the parent item red?
 
Alternatively a check mark field tied to the parent item that gets selected if ANY child item has a certain status/es would work.
 
Thanks

Comments

Armando

2017/06/20 16:53

In reply to by David_H

There are several ways to go at it.
One (simple) way involves creating a separate Y/N (boolean) field for each color.
Then, for each of these new Y/N fields, you insert equations so that they automatically add a value to the parent itemcolor field when all children have a specific color.
Here's what you'd do:
 
 
The color is "yellow" in the example, but it could be alphanumeric codes. Check in your properties pane how the color is coded in your itemcolor field when you add a specific color to an item.
(note : you don't need to have these new Y/N fields appear in the grid for anything to function -- they're just there for the equations.)

[quote=David_H]
- If ANY child item, no mater how many levels deep are formatted red, automatically format the parent item red?
[/quote]
 
Previous example was for your first request.
For this one, just replace the "max" in the column equation with "min".
 
Note that those column equations don't "know" where is the last parent in a multilevel hierarchy. So all parents that have children meeting the correct criteria will be colored... to the top (if every level meets the criteria).
I don't know any way to know if a parent is the last one/first one in a hierarchy. I don,t know if it's even possible to know it with a script.
It might be possible to work around this limitation using extra VBScript functions that would limit the coloring of items to those items meeting some other criteria (e.g. would show colors only when some field is checked ).
It's a bit more complicated to manage  (you'd have to remember checking that field for the colors do show up) and maybe not necessary for what you need...?
 

 Thanks Armando, I will play with this when I get a chance, I may have some more questions, we shall see....

Armando

2017/06/21 15:10

In reply to by David_H

No problem.
(Note that the newly created Y/N fields do not need to be manually checked. You don't need to ever look at those fields again if they do what you want : as soon as you'll apply a color to an item, they will automatically be triggered and do their thing -- that's what the row equation does in those fields. I forgot to mention...)