For the complete documentation index, see llms.txt. This page is also available as Markdown.

Conditional Formatting for Color of Cells in a Related List

There may be some situations where you may want to color the cells in your related list. This can be done by using bgcolor='color'. While this is simple enough, a more complex case arises when you want the color of the cell to change based on conditional logic. Below is an example of this.

An important note to this is that most of the <> symbols will need to be escaped (#lt, #gt) in order for this to work and be properly read.

<table>
<thead>
<tr>
<th>id</th>
<th>amount</th>
<th>amountrender</th>
</tr>
</thead>
<tbody><!--{{!
<lineitemsSOQL>
<class>none</class>
<soql> select id, amount from opportunity</soql>
<column prefix="<tr><td bgcolor='yellow'>" postfix="</td>">amount</column>
<column type="rtf" render="RECORD.amount >= 350000, lt#td bgcolor='blue' gt#RECORD.amount lt#/tdgt#,lt#td bgcolor='green'gt#RECORD.amount lt#/tdgt#"></column>
<column prefix="<td>" postfix="</td></tr>">amount</column>
</lineitemsSOQL>
}}-->
</tbody>
</table>

This can also be done with font color instead of background cell color:

Last updated

Was this helpful?