Hey Community,
i try to make some kind of "Traffic light system" for our items. I got a few ideas but i dont see any solutions.
For start it should work like this: By clicking an Checkbox "f.e. ERROR" Status should be RED.
As an OnCreate or OnEdit-Event
My Ideas:
1. using colors in Articles, looks like its not possible
2. by clicking an checkbox make an picture visible? Like "if(item.ERROR === true){ item.PICTURE_ERROR = visible }?
is it possible to change the property of an item between visble and not visible?
Even if i dont get a solution anyone problably have some ideas or other workarounds?
BR Carsten
Solved! Go to Solution.
Solved by sven.dickmans. Go to Solution.
I would recommend to use a computed field for this purpose as it does not require script code and will not add useless entries in the Change Log whenever the field changes. A computed field enables to render any kind of html content on the fly, based on logic rules - a very powerful feature.
In order to use this capability for your use case, add a new field of type 'Single Line Text' and click on 'Make this a computed field':
This will add a new input field, enabling you to enter a formula to determine the automatic cell content. Paste the code shown below which will evaluate the field 'ERROR' and either render a green or red color chip. The size and style of this chip is determined by the settings in the very first line.
'<div style="width:20px;height:20px;border-radius:3px;background-color:'||
CASE
WHEN (ERROR is false) THEN '#8fc844'
ELSE '#ee4c48'
END || '"></div>'
Once you save and add this field to your details page, the field will now be rendered for all your records, including existing ones.
The computed fields are quite unique and very powerful. The are also used in the standard applications, i.e. to highlight the priority of processes:
CASE
WHEN (PRIORITY = 2) THEN '<span sort="4" style="font-size:1.2em;color:#eb4d4d;">■■■</span>
WHEN (PRIORITY = 1) THEN '<span sort="3" style="font-size:1.2em;color:#FAA21B;">■■</span><span style="font-size:1.2em;color:#e4e4e4;">■</span>
WHEN (PRIORITY = 3) THEN '<span sort="2" style="font-size:1.2em;color:#8fc844;">■</span><span style="font-size:1.2em;color:#e4e4e4;">■■</span>'
ELSE '<span sort="1" style="font-size:1.2em;color:#e4e4e4;">■■■</span>'
END
Can't find what you're looking for? Ask the community or share your knowledge.