JavaScript field: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Stamp|2017-01-23|4.2.1|1.0.7}}
{{Stamp|2018-04-09|4.4.5|1.3.5}}


The value of the field will be the result of execution of the script defined in the field and executed in the entry context.
The value of the field will be the result of execution of the script defined in the field and executed in the entry context.
Line 36: Line 36:


{{FieldDepend}}
{{FieldDepend}}
== JavaScript fields not for charting ==
Unlike Calculation fields, JavaScript fields are not eligible for use in charting.


== Fields of an entry ==
== Fields of an entry ==
Line 204: Line 201:


<source lang="JavaScript">
<source lang="JavaScript">
var amt = field("Amount");
var amount = field("Amount");
if (amt < 0) "#FF0000";
if (amount < 0) "#FF0000";     // Red
else if (amt > 0) "#00FF00";
else if (amount > 0) "#00FF00"; // Green
</source>
</source>


Line 222: Line 219:
{{Template:JavaScriptLinks}}
{{Template:JavaScriptLinks}}


[[Category:Spec]]
[[Category:en]] [[Category:Spec]]

Navigation menu