Close
Thank you for your feedback.

Advanced style selection

Advanced style selection

The Value field on the Style form may contain JavaScript that is evaluated to determine if this style should be used for the field within a list.

You an set the Value to javascript:<script> to make the field value available to the script as the variable value. If the evaluated script returns true, the style is used for the list item.

For example, this value may be used to set the style for overdue items in the list, where current.u_datefield is the name of a date field on your table:

 javascript:gs.dateDiff(gs.now(), current.u_datefield.getDisplayValue(), true) < 0

The syntax javascript:<script> can only be used once in the Value field. If you want to enter multiple JavaScript conditions, they must be consolidated into one statement. For example, do not enter:

javascript: current.state == "Completed" javascript: current.error_tables > 0

Instead, enter:

javascript: current.state == "Completed" && current.error_tables > 0

Versions > Helsinki