Does the text override the value?
For display purposes, yes. But when accessing the field from any code, the value will still be taken.
Can a field have an empty value but show text to the user?
Of course. For example, if you need an information field that shows a constantly changing value in the warehouse — create an empty field and formatting:
f1=: setFormat(text: $format)
format: numFormat(num: $available; thousandssep: " "; unittype: " pcs")
available: select(table: 'warenhouse'; field: 'available'; where: 'id' = #product)
What is comment used for?
comment
does not override the main value of the field — it is displayed as an i
icon. When hovered over, a tooltip with the content passed in comment
will appear.
f1=: setFormat(condition: math`$round / $calc` != 1; comment: "It looks like the box is incomplete")
~calc: #quantity / #capacity_pcs
round: round(num: $calc;type: "down"; step: 1; dectimal: 0)