I have a field that I need to change color based on the content. This field is either a regular field or a computed for display field.
Something like @If(@uppercase(Status;"OPEN");Change to red; Keep Black)
I have a field that I need to change color based on the content. This field is either a regular field or a computed for display field.
Something like @If(@uppercase(Status;"OPEN");Change to red; Keep Black)
Simple solution: Two fields in two rows (paragraphs), one red, the other black. Use hide-when formulas to show only one field.
Two rows are necessary to have two different hide-when formulas.
If necessary, use a table (one column, two rows).
Right, In know that but is it difficult with the hide when in the same row. Can't be done. I want it to show in the same place. Guess I will have to have 2 rows with the hide when. I would be much easier and better to have a formula based color something like I stated.
There is no such option for a regular field. The only option is hidewhen as suggested by thomas bahn.
There is an @command(textsetfontcolor;color) but that applies to rich text field in edit mode .
Its in a form in a table. Not a view. I know there are work arounds and I did vote on a idea for this. Just didn't know if there was a different thing out there that I had not thought of.
so this is how I had to do it.
Create 2 rows with computed fields and then do the hide when on the text in the entire rows. PITA
You could have done it by just adding a table with two rows inside the column number 3 in first row with the hidewhen applied to fields status_d_red and status_d_green.
Good Point
Another way is to use passthru HTML. Not sure it will work on a field per se, but will certainly work on computed text based on the field value - no good for editing, but works nicely in read mode.
Advantage is that you can have any range of colours you want - you don't need a separate row/table cell for each colour (in this case you only want two, but in another case that might be useful.
Disadvantage is that it computes only on open.
We regret to inform you that it is not possible to achieve this requirement directly using a formula.
However, there are some workarounds that can help fulfill your requirement, as explained below:
Use a Rich Text Field : A Rich Text field supports formatting options, including the ability to change the font color using specific commands.
Use a Table with Two Separate Text Fields : You can design a table in the form that includes two different text fields — one with red font color and one with black font color.
Each field can be conditionally populated using formulas, depending on your requirements.
Field Name : Test1
Field Type : Text and Computed for display
Text Color : Black
@If(Status ="Open";@False;@True)
Field Name : Test2
Field Type : Text and Computed for display
Text Color : RED
Hide when formula : @If(Status ="Open";@True;@False)
Result :
If Status field value is "Open" then "RED" text will be displayed
If status field values is "Closed" then "Black" text will be displayed
Refer the following product documentation
URL --> https://help.hcl-software.com/dom_designer/14.0.0/basic/H_TEXTSETFONTCOLOR.html
We hope the information provided above helps in resolving your issue.