问题
I'm trying to highlight/indicate individual fields within a saved search column based on a certain criteria. I don't want to highlight the specific row as that will highlight the entire row and not just the single column.
The rudimentary code I have now is
CASE WHEN {custbody487} = 'On Time'
THEN {custbody487}
ELSE CASE WHEN {custbody487} = 'On Hold'
THEN {custbody487}
ELSE CASE WHEN {custbody487} = 'Late'
THEN {custbody487}
END END END
How do I conditionally highlight only a specific column? I want to highlight On Time as green, On Hold as blue, etc. But I only want to highlight the text in that specific column.
回答1:
You can add HTML formatting to saved searches.
Make sure you're using Formula(text) under results. Here's what the above code looks like highlighted.
CASE WHEN {custbody487} = 'On Time'
THEN '<span style="color:green;font-weight:bold">' || {custbody487} || '</span>'
ELSE CASE WHEN {custbody487} = 'Late'
THEN '<span style="color:red;font-weight:bold">' || {custbody487} || '</span>'
ELSE CASE WHEN {custbody487} = 'On Hold'
THEN '<span style="color:blue;font-weight:bold">' || {custbody487} || '</span>'
END END END
Be advised that searches saved this way will not keep their HTML formatting upon export to PDF or CSV. It will be formatted as plain text.
来源:https://stackoverflow.com/questions/55010836/saved-searches-conditional-html-formatting